22件ヒット
[1-22件を表示]
(0.015秒)
モジュール
- Forwardable (22)
キーワード
- delegate (11)
-
instance
_ delegate (11)
検索結果
-
Forwardable
# delegate(hash) -> () (14.0) -
メソッドの委譲先を設定します。
...します。
例:
require 'forwardable'
class Zap
extend Forwardable
delegate :length => :@str
delegate [:first, :last] => :@arr
def initialize
@arr = %w/foo bar baz/
@str = "world"
end
end
zap = Zap.new
zap.length # => 5
zap.first # => "foo"... -
Forwardable
# instance _ delegate(hash) -> () (14.0) -
メソッドの委譲先を設定します。
...します。
例:
require 'forwardable'
class Zap
extend Forwardable
delegate :length => :@str
delegate [:first, :last] => :@arr
def initialize
@arr = %w/foo bar baz/
@str = "world"
end
end
zap = Zap.new
zap.length # => 5
zap.first # => "foo"...