るりまサーチ

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

別のキーワード

  1. _builtin to_proc
  2. _builtin proc
  3. proc curry
  4. httpserver mount_proc
  5. readline completion_proc

ライブラリ

クラス

モジュール

キーワード

検索結果

Proc#ruby2_keywords -> proc (21184.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...
...ds or a keyword splat, the
final element is interpreted as keywords. In other words, keywords will
be passed through the proc to other methods.

This should only be used for procs that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.

This met...
...before 2.7, check that the proc responds to this method before calling
it. Also, be aware that if this method is removed, the behavior of the
proc
will change so that it does not pass through keywords.

//emlist[][ruby]{
module Mod
foo = ->(meth, *args, &block) do
send
(:"do_#{meth}", *args, &b...

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

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

...クもそのまま引き渡します。

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

send
, __send__ は、メソッドの呼び出し制限...
...ば良い場合は
Object#public_send を使う方が良いでしょう。

@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引数です。

//emlist[][ruby]{
p -365.send(:abs) #=> 365
p "ruby".send(:sub,/./,"R") #=> "Ruby"


class...
...ーバは任意(Foo クラスのインスタンスである必要もない)
p Foo.new.send(methods[1]) # => "foo"
p Foo.new.send(methods[2]) # => "bar"
p Foo.new.send(methods[3]) # => "baz"
//}

@see Object#public_send, BasicObject#__send__, Object#method, Kernel.#eval, Proc, Method...

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

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

...クもそのまま引き渡します。

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

send
, __send__ は、メソッドの呼び出し制限...
...ば良い場合は
Object#public_send を使う方が良いでしょう。

@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引数です。

//emlist[][ruby]{
p -365.send(:abs) #=> 365
p "ruby".send(:sub,/./,"R") #=> "Ruby"


class...
...ーバは任意(Foo クラスのインスタンスである必要もない)
p Foo.new.send(methods[1]) # => "foo"
p Foo.new.send(methods[2]) # => "bar"
p Foo.new.send(methods[3]) # => "baz"
//}

@see Object#public_send, BasicObject#__send__, Object#method, Kernel.#eval, Proc, Method...

MiniTest::Assertions#assert_send(array, message = nil) -> true (6126.0)

引数から、式を取り出して評価した結果が真の場合、検査にパスしたことになります。

...します。
文字列か Proc を指定します。Proc である場合は Proc#call した
結果を使用します。

@raise MiniTest::Assertion 取り出した式が偽を返す場合に発生します。

例:
assert_send([%w[foo bar baz], :include?, 'baz'])...

MiniTest::Assertions#assert_operator(operand1, operator, operand2, message = nil) -> true (25.0)

与えられたオブジェクトから作成する式を評価した結果が真を返す場合、検査にパスしたことになります。

...@param message 検査に失敗した場合に表示するメッセージを指定します。
文字列か Proc を指定します。Proc である場合は Proc#call した
結果を使用します。

@raise MiniTest::Assertion 与えられたオブジェクトか...
...ら作成する式を評価した結果が真でない場合に発生します。

例:
# 以下の二つは同じ
assert_operator('aaa', :==, 'aaa', 'message')
assert('aaa'.__send__(:==, 'aaa'), 'message')...

絞り込み条件を変える