D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Module
/
Filename :
ruby2_keywords-i.ri
back
Copy
U:RDoc::AnyMethod[iI"ruby2_keywords:ETI"Module#ruby2_keywords;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"NFor the given method names, marks the method as passing keywords through ;TI"Ja normal argument splat. This should only be called on methods that ;TI"Laccept an argument splat (<tt>*args</tt>) but not explicit keywords or ;TI"Ma keyword splat. It marks the method such that if the method is called ;TI"Nwith keyword arguments, the final hash argument is marked with a special ;TI"Mflag such that if it is the final element of a normal argument splat to ;TI"Ianother method call, and that method call does not include explicit ;TI"Pkeywords or a keyword splat, the final element is interpreted as keywords. ;TI"IIn other words, keywords will be passed through the method to other ;TI" methods.;To:RDoc::Markup::BlankLine o; ; [ I"LThis should only be used for methods that delegate keywords to another ;TI"Qmethod, and only for backwards compatibility with Ruby versions before 3.0. ;TI"rSee https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ ;TI"Kfor details on why +ruby2_keywords+ exists and when and how to use it.;T@o; ; [I"KThis method will probably be removed at some point, as it exists only ;TI"Ofor backwards compatibility. As it does not exist in Ruby versions before ;TI"J2.7, check that the module responds to this method before calling it:;T@o:RDoc::Markup::Verbatim; [I"module Mod ;TI"$ def foo(meth, *args, &block) ;TI", send(:"do_#{meth}", *args, &block) ;TI" end ;TI"B ruby2_keywords(:foo) if respond_to?(:ruby2_keywords, true) ;TI" end ;T:@format0o; ; [I"KHowever, be aware that if the +ruby2_keywords+ method is removed, the ;TI"Obehavior of the +foo+ method using the above approach will change so that ;TI"/the method does not pass through keywords.;T: @fileI"vm_method.c;T:0@omit_headings_from_table_of_contents_below0I"0ruby2_keywords(method_name, ...) -> nil ;T0[ I"(*args);T@0FI"Module;TcRDoc::NormalClass00