Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby21
/
share
/
ri
/
2.1.0
/
system
/
Proc
/
//opt/alt/ruby21/share/ri/2.1.0/system/Proc/call-i.ri
U:RDoc::AnyMethod[iI" call:ETI"Proc#call;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"HInvokes the block, setting the block's parameters to the values in ;TI"F<i>params</i> using something close to method calling semantics. ;TI"FGenerates a warning if multiple values are passed to a proc that ;TI"Iexpects just one (previously this silently converted the parameters ;TI"Lto an array). Note that prc.() invokes prc.call() with the parameters ;TI"0given. It's a syntax sugar to hide "call".;To:RDoc::Markup::BlankLine o; ; [ I"OFor procs created using <code>lambda</code> or <code>->()</code> an error ;TI"Nis generated if the wrong number of parameters are passed to a Proc with ;TI"Lmultiple parameters. For procs created using <code>Proc.new</code> or ;TI"G<code>Kernel.proc</code>, extra parameters are silently discarded.;T@o; ; [I"JReturns the value of the last expression evaluated in the block. See ;TI""also <code>Proc#yield</code>.;T@o:RDoc::Markup::Verbatim; [ I"6a_proc = Proc.new {|a, *b| b.collect {|i| i*a }} ;TI"/a_proc.call(9, 1, 2, 3) #=> [9, 18, 27] ;TI"/a_proc[9, 1, 2, 3] #=> [9, 18, 27] ;TI"a_proc = lambda {|a,b| a} ;TI"a_proc.call(1,2,3) ;T:@format0o; ; [I"<em>produces:</em>;T@o;; [I"Yprog.rb:4:in `block in <main>': wrong number of arguments (3 for 2) (ArgumentError) ;TI" from prog.rb:5:in `call' ;TI" from prog.rb:5:in `<main>';T; 0: @fileI"proc.c;T:0@omit_headings_from_table_of_contents_below0I""prc.call(params,...) -> obj;T0[ I"(*args);T@-FI" Proc;TcRDoc::NormalClass00