別のキーワード
検索結果
先頭3件
-
Object
# send(name , *args) -> object (21417.0) -
オブジェクトのメソッド name を args を引数に して呼び出し、メソッドの実行結果を返します。
...クトのメソッド name を args を引数に
して呼び出し、メソッドの実行結果を返します。
ブロック付きで呼ばれたときはブロックもそのまま引き渡します。
send が再定義された場合に備えて別名 __send__ も
用意されており、ラ......_send__ は再定義すべきではありません。
send, __send__ は、メソッドの呼び出し制限
にかかわらず任意のメソッドを呼び出せます。
d:spec/def#limit も参照してください。
public メソッドだけ呼び出せれば良い場合は
Object#public_send......しょう。
@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引数です。
//emlist[][ruby]{
p -365.send(:abs) #=> 365
p "ruby".send(:sub,/./,"R") #=> "Ruby"
class Foo
def foo() "foo" end
def bar() "bar" end
def baz() "b... -
Object
# send(name , *args) { . . . . } -> object (21417.0) -
オブジェクトのメソッド name を args を引数に して呼び出し、メソッドの実行結果を返します。
...クトのメソッド name を args を引数に
して呼び出し、メソッドの実行結果を返します。
ブロック付きで呼ばれたときはブロックもそのまま引き渡します。
send が再定義された場合に備えて別名 __send__ も
用意されており、ラ......_send__ は再定義すべきではありません。
send, __send__ は、メソッドの呼び出し制限
にかかわらず任意のメソッドを呼び出せます。
d:spec/def#limit も参照してください。
public メソッドだけ呼び出せれば良い場合は
Object#public_send......しょう。
@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引数です。
//emlist[][ruby]{
p -365.send(:abs) #=> 365
p "ruby".send(:sub,/./,"R") #=> "Ruby"
class Foo
def foo() "foo" end
def bar() "bar" end
def baz() "b... -
Module
# ruby2 _ keywords(method _ name , . . . ) -> nil (12581.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 arguments......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 th......ethod to
other methods.
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...