348件ヒット
[1-100件を表示]
(0.097秒)
別のキーワード
ライブラリ
- delegate (240)
- forwardable (48)
- openssl (12)
-
shell
/ command-processor (12) - weakref (12)
クラス
- Delegator (168)
-
Shell
:: CommandProcessor (12) - SimpleDelegator (36)
- WeakRef (12)
モジュール
- Forwardable (24)
- Kernel (12)
-
OpenSSL
:: OCSP (12) - SingleForwardable (24)
キーワード
- ! (12)
- != (12)
- == (12)
- DelegateClass (12)
- Delegator (12)
- NODELEGATED (12)
- NoDelegateMethods (6)
- Ruby用語集 (12)
- SimpleDelegator (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) -
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) -
メソッドの委譲先を設定します。
...tring かその配列で指定します。
例:
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... -
SingleForwardable
# delegate(hash) -> () (24208.0) -
メソッドの委譲先を設定します。
...メソッドの委譲先を設定します。
@param hash 委譲先のメソッドがキー、委譲先のオブジェクトが値の
Hash を指定します。キーは Symbol、
String かその配列で指定します。
@see Forwardable#delegate... -
Ruby用語集 (23034.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...Ruby用語集
A B C D E F G I J M N O R S Y
a ka sa ta na ha ma ya ra wa
=== 記号・数字
: %記法
: % notation
「%」記号で始まる多種多様なリテラル記法の総称。
参照:d:spec/literal#percent
: 0 オリジン
: zero-ba......sed
番号が 0 から始まること。
例えば、
Array や Vector、Matrix などの要素の番号、
String における文字の位置、
といったものは 0 オリジンである。
: 1 オリジン
: one-based
番号が 1 から始まること。
例えば、
エラ......ッシュに呼び出しを丸投げすることで実装が簡素化できる。
標準添付ライブラリーには、委譲を支援する delegate や
forwardable がある。
: イテレーター
: iterator
一般には繰り返し(反復)を抽象化する仕組み全般を指す... -
Kernel
# DelegateClass(superclass) -> object (20206.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]
//}... -
Delegator
# _ _ getobj _ _ -> object (14100.0) -
委譲先のオブジェクトを返します。
委譲先のオブジェクトを返します。
本メソッドは、サブクラスで再定義する必要があり、
デフォルトでは NotImplementedError が発生します。
@raise NotImplementedError サブクラスにて本メソッドが再定義されていない場合に発生します。 -
Delegator
# method _ missing(m , *args) -> object (14100.0) -
渡されたメソッド名と引数を使って、Delegator#__getobj__ が返すオブジェクトへメソッド委譲を行います。
...名と引数を使って、Delegator#__getobj__ が返すオブジェクトへメソッド委譲を行います。
@param m メソッドの名前(シンボル)
@param args メソッドに渡された引数
@return 委譲先のメソッドからの返り値
@see BasicObject#method_missing... -
Delegator
# respond _ to _ missing?(m , include _ private) -> bool (14100.0) -
@param m メソッド名を指定します。
@param m メソッド名を指定します。
@param include_private 真を指定すると private メソッドも調べます。 -
SimpleDelegator
# _ _ getobj _ _ -> object (14100.0) -
委譲先のオブジェクトを返します。
...委譲先のオブジェクトを返します。
@see Delegator#__getobj__...