226件ヒット
[1-100件を表示]
(0.134秒)
ライブラリ
- forwardable (187)
モジュール
- Forwardable (99)
- SingleForwardable (66)
キーワード
-
FORWARDABLE
_ VERSION (11) -
NEWS for Ruby 2
. 6 . 0 (6) - Ruby用語集 (11)
- SingleForwardable (11)
- debug (11)
- debug= (11)
-
def
_ delegator (22) -
def
_ delegators (22) -
def
_ instance _ delegator (11) -
def
_ instance _ delegators (11) -
def
_ single _ delegator (11) -
def
_ single _ delegators (11) - delegate (22)
- forwardable (11)
-
instance
_ delegate (11) -
ruby 1
. 6 feature (11) -
single
_ delegate (11)
検索結果
先頭5件
-
Forwardable (44012.0)
-
クラスに対し、メソッドの委譲機能を定義するモジュールです。
...いところに注意して下さい。
例:
require 'forwardable'
class Foo
extend Forwardable
def_delegators("@out", "printf", "print")
def_delegators(:@in, :gets)
def_delegator(:@contents, :[], "content_at")
end
f = Foo.new
f.printf ...
f.gets
f.content_at(1)... -
Forwardable
:: FORWARDABLE _ VERSION -> String (36217.0) -
forwardable ライブラリのバージョンを返します。
...
forwardable ライブラリのバージョンを返します。... -
Forwardable
# def _ delegator(accessor , method , ali = method) -> () (27118.0) -
メソッドの委譲先を設定します。
...メソッドの委譲先を設定します。
@param accessor 委譲先のオブジェクト
@param method 委譲先のメソッド
@param ali 委譲元のメソッド
委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が......することが可能です。
def_delegator は def_instance_delegator の別名になります。
例:
require 'forwardable'
class MyQueue
extend Forwardable
attr_reader :queue
def initialize
@queue = []
end
def_delegator :@queue, :push, :mypush
end
q = MyQue......ue.new
q.mypush 42
q.queue # => [42]
q.push 23 # => NoMethodError
@see Forwardable#def_delegators... -
Forwardable
# def _ instance _ delegator(accessor , method , ali = method) -> () (27118.0) -
メソッドの委譲先を設定します。
...メソッドの委譲先を設定します。
@param accessor 委譲先のオブジェクト
@param method 委譲先のメソッド
@param ali 委譲元のメソッド
委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が......することが可能です。
def_delegator は def_instance_delegator の別名になります。
例:
require 'forwardable'
class MyQueue
extend Forwardable
attr_reader :queue
def initialize
@queue = []
end
def_delegator :@queue, :push, :mypush
end
q = MyQue......ue.new
q.mypush 42
q.queue # => [42]
q.push 23 # => NoMethodError
@see Forwardable#def_delegators... -
Forwardable
# def _ delegators(accessor , *methods) -> () (27106.0) -
メソッドの委譲先をまとめて設定します。
...メソッドの委譲先をまとめて設定します。
@param accessor 委譲先のオブジェクト
@param methods 委譲するメソッドのリスト
委譲元のオブジェクトで methods のそれぞれのメソッドが呼び出された場合に、
委譲先のオブジェクトの......_delegators は def_instance_delegators の別名になります。
また、以下の 2 つの例は同じ意味です。
def_delegators :@records, :size, :<<, :map
def_delegator :@records, :size
def_delegator :@records, :<<
def_delegator :@records, :map
@see Forwardable#def_delegator... -
Forwardable
# def _ instance _ delegators(accessor , *methods) -> () (27106.0) -
メソッドの委譲先をまとめて設定します。
...メソッドの委譲先をまとめて設定します。
@param accessor 委譲先のオブジェクト
@param methods 委譲するメソッドのリスト
委譲元のオブジェクトで methods のそれぞれのメソッドが呼び出された場合に、
委譲先のオブジェクトの......_delegators は def_instance_delegators の別名になります。
また、以下の 2 つの例は同じ意味です。
def_delegators :@records, :size, :<<, :map
def_delegator :@records, :size
def_delegator :@records, :<<
def_delegator :@records, :map
@see Forwardable#def_delegator... -
Forwardable
# delegate(hash) -> () (24012.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"... -
Forwardable
# instance _ delegate(hash) -> () (24012.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"... -
Forwardable
. debug -> bool (24000.0) -
委譲部分をバックトレースに含めるかどうかの状態を返します。
委譲部分をバックトレースに含めるかどうかの状態を返します。
バックトレースを含める設定となっている時、真を返します。
デフォルトは含めない設定となっています。 -
Forwardable
. debug= -> bool (24000.0) -
委譲部分をバックトレースに含めるかどうかの状態を設定します。
委譲部分をバックトレースに含めるかどうかの状態を設定します。