別のキーワード
ライブラリ
- ビルトイン (10)
- delegate (220)
- forwardable (44)
- openssl (11)
-
shell
/ command-processor (12) - weakref (22)
クラス
- Delegator (154)
- Module (5)
- Proc (5)
-
Shell
:: CommandProcessor (12) - SimpleDelegator (33)
- WeakRef (11)
モジュール
- Forwardable (22)
- Kernel (11)
-
OpenSSL
:: OCSP (11) - SingleForwardable (22)
キーワード
- ! (11)
- != (11)
- == (11)
- DelegateClass (11)
- Delegator (11)
-
NEWS for Ruby 2
. 7 . 0 (5) - NODELEGATED (11)
- NoDelegateMethods (6)
- Ruby用語集 (11)
- SimpleDelegator (11)
- WeakRef (11)
-
_ _ getobj _ _ (33) -
_ _ setobj _ _ (22) -
add
_ delegate _ command _ to _ shell (6) - freeze (11)
-
instance
_ delegate (11) -
marshal
_ dump (11) -
marshal
_ load (11) -
method
_ missing (11) - methods (11)
- new (11)
-
protected
_ methods (11) -
public
_ methods (11) -
respond
_ to? (11) -
respond
_ to _ missing? (11) -
ruby 1
. 8 . 3 feature (11) -
ruby2
_ keywords (10) -
single
_ delegate (11)
検索結果
先頭5件
-
delegate (38000.0)
-
メソッドの委譲 (delegation) を行うためのライブラリです。
...or の利用例の一つであり、
コンストラクタに渡されたオブジェクトにメソッドの実行を委譲します。
Kernel#DelegateClass は 引数で渡されたクラスのインスタンスをひとつとり、
そのオブジェクトにインスタンスメソッドを委... -
Forwardable
# delegate(hash) -> () (18114.0) -
メソッドの委譲先を設定します。
...l、
String かその配列で指定します。
例:
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... -
SingleForwardable
# delegate(hash) -> () (18108.0) -
メソッドの委譲先を設定します。
...メソッドの委譲先を設定します。
@param hash 委譲先のメソッドがキー、委譲先のオブジェクトが値の
Hash を指定します。キーは Symbol、
String かその配列で指定します。
@see Forwardable#delegate... -
Kernel
# DelegateClass(superclass) -> object (14106.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]
//}... -
SimpleDelegator (8006.0)
-
Delegator クラスを継承し、シンプルなメソッド委譲を実現した具象クラス。
...し、シンプルなメソッド委譲を実現した具象クラス。
委譲先に指定されたオブジェクトへメソッドの実行を委譲します。
例:
//emlist{
require 'delegate'
foo = Object.new
def foo.test
p 25
end
foo2 = SimpleDelegator.new(foo)
foo2.test # => 25
//}... -
Delegator (8000.0)
-
サブクラスにメソッド委譲の仕組みを提供する抽象クラス。
サブクラスにメソッド委譲の仕組みを提供する抽象クラス。
メソッド委譲を行う場合は、本クラスを継承しDelegator#__getobj__を再定義する必要があります。
具体的な使用例については、SimpleDelegatorを参照してください。 -
Delegator
# ! -> bool (8000.0) -
自身を否定します。
自身を否定します。 -
Delegator
# !=(obj) -> bool (8000.0) -
自身が与えられたオブジェクトと等しくない場合は、真を返します。 そうでない場合は、偽を返します。
自身が与えられたオブジェクトと等しくない場合は、真を返します。
そうでない場合は、偽を返します。
@param obj 比較対象のオブジェクトを指定します。 -
Delegator
# ==(obj) -> bool (8000.0) -
自身が与えられたオブジェクトと等しい場合は、真を返します。 そうでない場合は、偽を返します。
自身が与えられたオブジェクトと等しい場合は、真を返します。
そうでない場合は、偽を返します。
@param obj 比較対象のオブジェクトを指定します。 -
Delegator
# _ _ getobj _ _ -> object (8000.0) -
委譲先のオブジェクトを返します。
委譲先のオブジェクトを返します。
本メソッドは、サブクラスで再定義する必要があり、
デフォルトでは NotImplementedError が発生します。
@raise NotImplementedError サブクラスにて本メソッドが再定義されていない場合に発生します。