るりまサーチ (Ruby 2.7.0)

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

別のキーワード

  1. irb/input-method new
  2. irb/input-method gets
  3. _builtin define_method
  4. irb/input-method encoding
  5. irb/input-method readable_atfer_eof?

クラス

キーワード

検索結果

Object#send(name, *args) -> object (54586.0)

オブジェクトのメソッド name を args を引数に して呼び出し、メソッドの実行結果を返します。

オブジェクトのメソッド name を args を引数に
して呼び出し、メソッドの実行結果を返します。

ブロック付きで呼ばれたときはブロックもそのまま引き渡します。

send が再定義された場合に備えて別名 __send__ も
用意されており、ライブラリではこちらを使うべきです。また
__send__ は再定義すべきではありません。

send, __send__ は、メソッドの呼び出し制限
にかかわらず任意のメソッドを呼び出せます。
d:spec/def#limit も参照してください。

public メソッドだけ呼び出せれば良い場合は
Object#public_send を使う...

Object#send(name, *args) { .... } -> object (54586.0)

オブジェクトのメソッド name を args を引数に して呼び出し、メソッドの実行結果を返します。

オブジェクトのメソッド name を args を引数に
して呼び出し、メソッドの実行結果を返します。

ブロック付きで呼ばれたときはブロックもそのまま引き渡します。

send が再定義された場合に備えて別名 __send__ も
用意されており、ライブラリではこちらを使うべきです。また
__send__ は再定義すべきではありません。

send, __send__ は、メソッドの呼び出し制限
にかかわらず任意のメソッドを呼び出せます。
d:spec/def#limit も参照してください。

public メソッドだけ呼び出せれば良い場合は
Object#public_send を使う...

Object#singleton_method(name) -> Method (18808.0)

オブジェクトの特異メソッド name をオブジェクト化した Method オブ ジェクトを返します。

オブジェクトの特異メソッド name をオブジェクト化した Method オブ
ジェクトを返します。

@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。

//emlist[][ruby]{
class Demo
def initialize(n)
@iv = n
end
def hello()
"Hello, @iv = #{@iv}"
end
end

k = Demo.new(99)
def k.hi
"Hi, @iv = ...

Object#method(name) -> Method (18790.0)

オブジェクトのメソッド name をオブジェクト化した Method オブジェクトを返します。

オブジェクトのメソッド name をオブジェクト化した
Method オブジェクトを返します。

@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。

//emlist[][ruby]{
me = -365.method(:abs)
p me #=> #<Method: Integer#abs>
p me.call #=> 365
//}

@see Module#instance_method, Method, BasicObject#__send__, Objec...

Object#public_method(name) -> Method (18790.0)

オブジェクトの public メソッド name をオブジェクト化した Method オブジェクトを返します。

オブジェクトの public メソッド name をオブジェクト化した
Method オブジェクトを返します。

@param name メソッド名を Symbol または String で指定します。
@raise NameError 定義されていないメソッド名や、
protected メソッド名、 private メソッド名を引数として与えると発生します。

//emlist[][ruby]{
1.public_method(:to_int) #=> #<Method: Integer#to_int>
1.public_method(:p) # method ...

絞り込み条件を変える

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

Proc#ruby2_keywords -> proc (196.0)

Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc 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 proc to other methods.

Marks the proc as passing keywords through a normal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
but not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked ...