るりまサーチ

最速Rubyリファレンスマニュアル検索!
82件ヒット [1-82件を表示] (0.130秒)

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n
  3. openssl n
  4. pop n_bytes
  5. openssl n=

ライブラリ

クラス

モジュール

検索結果

SingleForwardable#delegate(hash) -> () (21109.0)

メソッドの委譲先を設定します。

...メソッドの委譲先を設定します。

@param hash 委譲先のメソッドがキー、委譲先のオブジェクトが値の
Hash を指定します。キーは Symbol、
String かその配列で指定します。

@see Forwardable#delegate...

Kernel#DelegateClass(superclass) -> object (17107.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#method_missing(m, *args) -> object (14101.0)

渡されたメソッド名と引数を使って、Delegator#__getobj__ が返すオブジェクトへメソッド委譲を行います。

...名と引数を使って、Delegator#__getobj__ が返すオブジェクトへメソッド委譲を行います。

@param m メソッドの名前(シンボル)

@param args メソッドに渡された引数

@return 委譲先のメソッドからの返り値

@see BasicObject#method_missing...

Delegator#respond_to?(m) -> bool (14101.0)

Delegator#__getobj__ が返すオブジェクトが メソッド m を持つとき真を返します。

...Delegator#__getobj__ が返すオブジェクトが メソッド m を持つとき真を返します。

@param m メソッド名

@see Object#respond_to?...

Delegator#respond_to_missing?(m, include_private) -> bool (14101.0)

@param m メソッド名を指定します。

...@param m メソッド名を指定します。

@param include_private 真を指定すると private メソッドも調べます。...

絞り込み条件を変える

SingleForwardable#single_delegate(hash) -> () (12209.0)

メソッドの委譲先を設定します。

...メソッドの委譲先を設定します。

@param hash 委譲先のメソッドがキー、委譲先のオブジェクトが値の
Hash を指定します。キーは Symbol、
String かその配列で指定します。

@see Forwardable#delegate...

Forwardable#instance_delegate(hash) -> () (9215.0)

メソッドの委譲先を設定します。

...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...

Module#ruby2_keywords(method_name, ...) -> nil (107.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

...ven method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword arguments, the fina...
...l hash argument is marked with a special
flag such that if it is the final element of a normal argument splat to
another method call, and that method call does not include explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed thro...
...This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.

This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
before 2.7, c...