3件ヒット
[1-3件を表示]
(0.023秒)
種類
- クラス (1)
- インスタンスメソッド (1)
- 特異メソッド (1)
クラス
- SimpleDelegator (1)
モジュール
- Kernel (1)
キーワード
- DelegateClass (1)
- SimpleDelegator (1)
検索結果
-
SimpleDelegator
. new(obj) -> object (54328.0) -
メソッドを委譲するオブジェクトの設定と、 メソッド委譲を行うためのクラスメソッドの定義を行います。
メソッドを委譲するオブジェクトの設定と、
メソッド委譲を行うためのクラスメソッドの定義を行います。
@param obj 委譲先のオブジェクト
@see Delegator.new -
SimpleDelegator (43.0)
-
Delegator クラスを継承し、シンプルなメソッド委譲を実現した具象クラス。
...し、シンプルなメソッド委譲を実現した具象クラス。
委譲先に指定されたオブジェクトへメソッドの実行を委譲します。
例:
//emlist{
require 'delegate'
foo = Object.new
def foo.test
p 25
end
foo2 = SimpleDelegator.new(foo)
foo2.test # => 25
//}... -
Kernel
# DelegateClass(superclass) -> object (25.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]
//}...