るりまサーチ

最速Rubyリファレンスマニュアル検索!
36件ヒット [1-36件を表示] (0.078秒)

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

ライブラリ

モジュール

キーワード

検索結果

Forwardable#delegate(hash) -> () (18121.0)

メソッドの委譲先を設定します。

...定します。キーは Symbol、
String かその配列で指定します。


例:

require
'forwardable'
class Zap
extend Forwardable
delegate
:length => :@str
delegate
[:first, :last] => :@arr
def initialize
@arr = %w/foo bar baz/
@str = "worl...

Kernel#DelegateClass(superclass) -> object (14113.0)

クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、 そのクラスを返します。

...るクラスを定義し、
そのクラスを返します。

@param superclass 委譲先となるクラス

例:

//emlist{
require
'delegate'

class ExtArray < DelegateClass(Array)
def initialize
super([])
end
end
a = ExtArray.new
p a.class # => ExtArray
a.push 25
p a # => [25]...

Forwardable#instance_delegate(hash) -> () (6121.0)

メソッドの委譲先を設定します。

...定します。キーは Symbol、
String かその配列で指定します。


例:

require
'forwardable'
class Zap
extend Forwardable
delegate
:length => :@str
delegate
[:first, :last] => :@arr
def initialize
@arr = %w/foo bar baz/
@str = "worl...