396件ヒット
[1-100件を表示]
(0.109秒)
ライブラリ
- ビルトイン (18)
- delegate (240)
- forwardable (48)
- openssl (12)
-
shell
/ command-processor (12) - weakref (24)
クラス
- Delegator (168)
- Module (12)
- Proc (6)
-
Shell
:: CommandProcessor (12) - SimpleDelegator (36)
- WeakRef (12)
モジュール
- Forwardable (24)
- Kernel (12)
-
OpenSSL
:: OCSP (12) - SingleForwardable (24)
キーワード
- ! (12)
- != (12)
- == (12)
- DelegateClass (12)
- Delegator (12)
-
NEWS for Ruby 2
. 7 . 0 (6) - NODELEGATED (12)
- NoDelegateMethods (6)
- Ruby用語集 (12)
- SimpleDelegator (12)
- WeakRef (12)
-
_ _ getobj _ _ (36) -
_ _ setobj _ _ (24) -
add
_ delegate _ command _ to _ shell (6) - freeze (12)
-
instance
_ delegate (12) -
marshal
_ dump (12) -
marshal
_ load (12) -
method
_ missing (12) - methods (12)
- new (12)
-
protected
_ methods (12) -
public
_ methods (12) -
respond
_ to? (12) -
respond
_ to _ missing? (12) -
ruby 1
. 8 . 3 feature (12) -
ruby2
_ keywords (18) -
single
_ delegate (12)
検索結果
先頭5件
-
delegate (44000.0)
-
メソッドの委譲 (delegation) を行うためのライブラリです。
...メソッドの委譲 (delegation) を行うためのライブラリです。
Delegator クラスは指定したオブジェクトにメソッドの実行を委譲します。
Delegator クラスを利用する場合はこれを継承して
Delegator#__getobj__ メソッドを再定義して委譲......先のオブジェクトを指定します。
SimpleDelegator は Delegator の利用例の一つであり、
コンストラクタに渡されたオブジェクトにメソッドの実行を委譲します。
Kernel#DelegateClass は 引数で渡されたクラスのインスタンスをひと......つとり、
そのオブジェクトにインスタンスメソッドを委譲するクラスを定義して返します。
=== 参考
* Rubyist Magazine - 標準添付ライブラリ紹介【第 6 回】委譲 https://magazine.rubyist.net/articles/0012/0012-BundledLibraries.html... -
Forwardable
# delegate(hash) -> () (24214.0) -
メソッドの委譲先を設定します。
...す。
@param hash 委譲先のメソッドがキー、委譲先のオブジェクトが値の
Hash を指定します。キーは 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
end
zap = Zap.new
zap.length # => 5
zap.first # => "foo"
zap.last # => "baz"... -
SingleForwardable
# delegate(hash) -> () (24208.0) -
メソッドの委譲先を設定します。
...メソッドの委譲先を設定します。
@param hash 委譲先のメソッドがキー、委譲先のオブジェクトが値の
Hash を指定します。キーは Symbol、
String かその配列で指定します。
@see Forwardable#delegate... -
Kernel
# DelegateClass(superclass) -> object (20230.0) -
クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、 そのクラスを返します。
...class のインスタンスへメソッドを委譲するクラスを定義し、
そのクラスを返します。
@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]
//}... -
Shell
:: CommandProcessor . add _ delegate _ command _ to _ shell(id) (15201.0) -
@todo
...@todo
Shell 自体を初期化する時に呼び出されるメソッドです。
ユーザが使用することはありません。
@param id メソッド名を指定します。... -
Delegator
# marshal _ dump -> object (14100.0) -
シリアライゼーションをサポートするためにDelegator#__getobj__ が返すオブジェクトを返します。
...シリアライゼーションをサポートするためにDelegator#__getobj__ が返すオブジェクトを返します。... -
Delegator
# marshal _ load(obj) -> object (14100.0) -
シリアライズされたオブジェクトから、Delegator#__getobj__ が返すオブジェクトを再現します。
...シリアライズされたオブジェクトから、Delegator#__getobj__ が返すオブジェクトを再現します。
@param obj Delegator#marshal_dumpの戻り値のコピー... -
SimpleDelegator (14006.0)
-
Delegator クラスを継承し、シンプルなメソッド委譲を実現した具象クラス。
...Delegator クラスを継承し、シンプルなメソッド委譲を実現した具象クラス。
委譲先に指定されたオブジェクトへメソッドの実行を委譲します。
例:
//emlist{
require 'delegate'
foo = Object.new
def foo.test
p 25
end
foo2 = SimpleDelegator.new(fo... -
Delegator (14000.0)
-
サブクラスにメソッド委譲の仕組みを提供する抽象クラス。
...サブクラスにメソッド委譲の仕組みを提供する抽象クラス。
メソッド委譲を行う場合は、本クラスを継承しDelegator#__getobj__を再定義する必要があります。
具体的な使用例については、SimpleDelegatorを参照してください。...