36件ヒット
[1-36件を表示]
(0.020秒)
ライブラリ
- delegate (12)
- forwardable (24)
モジュール
- Forwardable (24)
- Kernel (12)
キーワード
- DelegateClass (12)
-
instance
_ delegate (12)
検索結果
先頭3件
-
Kernel
# DelegateClass(superclass) -> object (20319.0) -
クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、 そのクラスを返します。
...クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、
そのクラスを返します。
@param superclass 委譲先となるクラス
例:
//emlist{
require 'delegate'
class ExtArray < DelegateClass(Array)
def initialize
super([])
end
end
a = E......xtArray.new
p a.class # => ExtArray
a.push 25
p a # => [25]
//}... -
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 = "world"
end... -
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 = "world"
end...