236件ヒット
[1-100件を表示]
(0.129秒)
ライブラリ
- ビルトイン (5)
- delegate (187)
- forwardable (44)
クラス
- Delegator (154)
- Module (5)
- SimpleDelegator (22)
モジュール
- Forwardable (22)
- Kernel (11)
- SingleForwardable (22)
キーワード
- ! (11)
- != (11)
- == (11)
- DelegateClass (11)
-
_ _ getobj _ _ (22) -
_ _ setobj _ _ (22) - freeze (11)
-
instance
_ delegate (11) -
marshal
_ dump (11) -
marshal
_ load (11) -
method
_ missing (11) - methods (11)
-
protected
_ methods (11) -
public
_ methods (11) -
respond
_ to? (11) -
respond
_ to _ missing? (11) -
ruby2
_ keywords (5) -
single
_ delegate (11)
検索結果
先頭5件
-
SingleForwardable
# delegate(hash) -> () (30209.0) -
メソッドの委譲先を設定します。
...メソッドの委譲先を設定します。
@param hash 委譲先のメソッドがキー、委譲先のオブジェクトが値の
Hash を指定します。キーは Symbol、
String かその配列で指定します。
@see Forwardable#delegate... -
Forwardable
# delegate(hash) -> () (27215.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
e......nd
zap = Zap.new
zap.length # => 5
zap.first # => "foo"
zap.last # => "baz"... -
SingleForwardable
# single _ delegate(hash) -> () (21309.0) -
メソッドの委譲先を設定します。
...メソッドの委譲先を設定します。
@param hash 委譲先のメソッドがキー、委譲先のオブジェクトが値の
Hash を指定します。キーは Symbol、
String かその配列で指定します。
@see Forwardable#delegate... -
Kernel
# DelegateClass(superclass) -> object (20207.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
# instance _ delegate(hash) -> () (15215.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
e......nd
zap = Zap.new
zap.length # => 5
zap.first # => "foo"
zap.last # => "baz"... -
Delegator
# marshal _ dump -> object (14101.0) -
シリアライゼーションをサポートするためにDelegator#__getobj__ が返すオブジェクトを返します。
...シリアライゼーションをサポートするためにDelegator#__getobj__ が返すオブジェクトを返します。... -
Delegator
# marshal _ load(obj) -> object (14101.0) -
シリアライズされたオブジェクトから、Delegator#__getobj__ が返すオブジェクトを再現します。
...シリアライズされたオブジェクトから、Delegator#__getobj__ が返すオブジェクトを再現します。
@param obj Delegator#marshal_dumpの戻り値のコピー... -
Delegator
# public _ methods(all = true) -> [Symbol] (14101.0) -
そのオブジェクトが理解できる public メソッド名の一覧を返します。
...そのオブジェクトが理解できる public メソッド名の一覧を返します。
@param all 偽を指定すると __getobj__ のスーパークラスで定義されたメソッドを除きます。
@see Object#public_methods... -
SimpleDelegator
# _ _ getobj _ _ -> object (14001.0) -
委譲先のオブジェクトを返します。
...委譲先のオブジェクトを返します。
@see Delegator#__getobj__... -
SimpleDelegator
# _ _ setobj _ _ (obj) -> object (14001.0) -
委譲先のオブジェクトを obj に変更します。
委譲先のオブジェクトを obj に変更します。
メソッド委譲を行うためのクラスメソッドの再定義は行われないことに注意してください。
メソッド委譲を行うためのクラスメソッドの定義は生成時にのみ行われます。
そのため、以前の委譲先オブジェクトと
obj の間で呼び出せるメソッドに違いがあった場合は、
何かしらの例外が発生する可能性があります。
@param obj 委譲先のオブジェクト
@return 変更後の委譲先オブジェクト