るりまサーチ

最速Rubyリファレンスマニュアル検索!
9件ヒット [1-9件を表示] (0.052秒)
トップページ > クエリ:nil[x] > クエリ:check[x] > クエリ:ruby2_keywords[x]

別のキーワード

  1. fiddle ruby_free
  2. fiddle build_ruby_platform
  3. rbconfig ruby
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

検索結果

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

...his method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist 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 s...
...o 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
//}...

NEWS for Ruby 3.0.0 (42.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...he first argument is a URI. 16686
* Net::SMTP
* Add SNI support.
* Net::SMTP.start arguments are keyword arguments.
* TLS should not check the host name by default.
* OpenStruct
* Initialization is no longer lazy. 12136
* Builtin methods can now be overridden safely. 15409...
...ow `{ a: 1 }.each(&->(k, v) { })` raises an ArgumentError due to lambda's arity check.
* When writing to STDOUT redirected to a closed pipe, no broken pipe error message will be shown now. 14413
* `TRUE`/`FALSE`/`NIL` constants are no longer defined.
* Integer#zero? overrides Numeric#zero? fo...
...ruby]{
# test.rb
def foo(x)
if x > 10
x.to_s
else
nil

end
end

foo(42)
//}

//emlist{
$ typeprof test.rb
# Classes
class Object
def foo : (Integer) -> String?
end
//}

== Miscellaneous changes

* Methods using `ruby2_keywords` will no longer keep empty keyword splats, those are now...