るりまサーチ

最速Rubyリファレンスマニュアル検索!
5件ヒット [1-5件を表示] (0.028秒)
トップページ > クラス:Module[x] > ライブラリ:ビルトイン[x] > クエリ:ruby2_keywords[x]

別のキーワード

  1. sax2parser listen
  2. rexml/parsers/sax2parser listen
  3. open3 popen2e
  4. open3 popen2
  5. socket iff_link2

検索結果

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

...st in Ruby versions
before 2.7, check that the module responds to this method before calling
it. Also, be aware that if this method is removed, the behavior of the
method will change so that it does not pass through keywords.

//emlist[例][ruby]{
module
Mod
def foo(meth, *args, &block)
send(:...
..."do_#{meth}", *args, &block)
end
ruby2_keywords(:foo) if respond_to?(:ruby2_keywords, true)
end
//}...