るりまサーチ (Ruby 2.7.0)

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. _builtin i
  5. ipaddr to_i

ライブラリ

クラス

モジュール

検索結果

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

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

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

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

@see Forwardable#delegate

Delegator#method_missing(m, *args) -> object (42304.0)

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

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

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

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

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

@see BasicObject#method_missing

Delegator#public_methods(all = true) -> [Symbol] (42304.0)

そのオブジェクトが理解できる public メソッド名の一覧を返します。

そのオブジェクトが理解できる public メソッド名の一覧を返します。

@param all 偽を指定すると __getobj__ のスーパークラスで定義されたメソッドを除きます。

@see Object#public_methods

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

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

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

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

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

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

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

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

@see Forwardable#delegate

絞り込み条件を変える

SimpleDelegator#__getobj__ -> object (33004.0)

委譲先のオブジェクトを返します。

委譲先のオブジェクトを返します。

@see Delegator#__getobj__

SimpleDelegator#__setobj__(obj) -> object (33004.0)

委譲先のオブジェクトを obj に変更します。

委譲先のオブジェクトを obj に変更します。

メソッド委譲を行うためのクラスメソッドの再定義は行われないことに注意してください。
メソッド委譲を行うためのクラスメソッドの定義は生成時にのみ行われます。
そのため、以前の委譲先オブジェクトと
obj の間で呼び出せるメソッドに違いがあった場合は、
何かしらの例外が発生する可能性があります。

@param obj 委譲先のオブジェクト

@return 変更後の委譲先オブジェクト

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

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

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

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


例:

require 'forwardable'
class Zap
extend Forwardable
delegate :length => :@str
delegate [:first, :last] => :@arr
def initialize
@arr = %w/fo...

Module#ruby2_keywords(method_name, ...) -> nil (322.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.

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