3 Matching Annotations
- Aug 2021
-
www.ruby-lang.org www.ruby-lang.org
-
You need to explicitly delegate keyword arguments. def foo(*args, **kwargs, &block) target(*args, **kwargs, &block) end
-
you can use the new delegation syntax (...) that is introduced in Ruby 2.7. def foo(...) target(...) end
-
In Ruby 2, you can write a delegation method by accepting a *rest argument and a &block argument, and passing the two to the target method. In this behavior, the keyword arguments are also implicitly handled by the automatic conversion between positional and keyword arguments.
-