%PDF- %PDF-
Direktori : /proc/self/root/opt/cpanel/ea-ruby24/root/usr/share/ri/system/Method/ |
Current File : //proc/self/root/opt/cpanel/ea-ruby24/root/usr/share/ri/system/Method/curry-i.ri |
U:RDoc::AnyMethod[iI" curry:ETI"Method#curry;TF:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [ I"ZReturns a curried proc based on the method. When the proc is called with a number of ;TI"]arguments that is lower than the method's arity, then another curried proc is returned. ;TI"]Only when enough arguments have been supplied to satisfy the method signature, will the ;TI"method actually be called.;To:RDoc::Markup::BlankLine o; ; [I"VThe optional <i>arity</i> argument should be supplied when currying methods with ;TI"Xvariable arguments to determine how many arguments are needed before the method is ;TI"called.;T@o:RDoc::Markup::Verbatim; [I"def foo(a,b,c) ;TI" [a, b, c] ;TI" end ;TI" ;TI"%proc = self.method(:foo).curry ;TI"2proc2 = proc.call(1, 2) #=> #<Proc> ;TI"2proc2.call(3) #=> [1,2,3] ;TI" ;TI"def vararg(*args) ;TI" args ;TI" end ;TI" ;TI"*proc = self.method(:vararg).curry(4) ;TI",proc2 = proc.call(:x) #=> #<Proc> ;TI",proc3 = proc2.call(:y, :z) #=> #<Proc> ;TI"4proc3.call(:a) #=> [:x, :y, :z, :a];T:@format0: @fileI"proc.c;T:0@omit_headings_from_table_of_contents_below0I"9meth.curry -> proc meth.curry(arity) -> proc ;T0[ I"(*args);T@)FI"Method;TcRDoc::NormalClass00