PATH:
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Method
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
[-] %3c%3c-i.ri
[edit]
[-] to_s-i.ri
[edit]
[-] curry-i.ri
[edit]
[-] cdesc-Method.ri
[edit]
[-] clone-i.ri
[edit]
[-] hash-i.ri
[edit]
[-] to_proc-i.ri
[edit]
[-] name-i.ri
[edit]
[-] %3d%3d%3d-i.ri
[edit]
[-] eql%3f-i.ri
[edit]
[-] %5b%5d-i.ri
[edit]
[-] %3e%3e-i.ri
[edit]
[-] call-i.ri
[edit]
[+]
..
[-] owner-i.ri
[edit]
[-] original_name-i.ri
[edit]
[-] unbind-i.ri
[edit]
[-] source_location-i.ri
[edit]
[-] %3d%3d-i.ri
[edit]
[-] inspect-i.ri
[edit]
[-] super_method-i.ri
[edit]
[-] receiver-i.ri
[edit]
[-] parameters-i.ri
[edit]
[-] arity-i.ri
[edit]