--- !ruby/object:RDoc::RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: Returns a curried proc. If the optional <em>arity</em> argument is given, it determines the number of arguments. A curried proc receives some arguments. If a sufficient number of arguments are supplied, it passes the supplied arguments to the original proc and returns the result. Otherwise, returns another curried proc that takes the rest of arguments.
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "   b = proc {|x, y, z| (x||0) + (y||0) + (z||0) }\n   p b.curry[1][2][3]           #=&gt; 6\n   p b.curry[1, 2][3, 4]        #=&gt; 6\n   p b.curry(5)[1][2][3][4][5]  #=&gt; 6\n   p b.curry(5)[1, 2][3, 4][5]  #=&gt; 6\n   p b.curry(1)[1]              #=&gt; 1\n\n   b = proc {|x, y, z, *w| (x||0) + (y||0) + (z||0) + w.inject(0, &amp;:+) }\n   p b.curry[1][2][3]           #=&gt; 6\n   p b.curry[1, 2][3, 4]        #=&gt; 10\n   p b.curry(5)[1][2][3][4][5]  #=&gt; 15\n   p b.curry(5)[1, 2][3, 4][5]  #=&gt; 15\n   p b.curry(1)[1]              #=&gt; 1\n\n   b = lambda {|x, y, z| (x||0) + (y||0) + (z||0) }\n   p b.curry[1][2][3]           #=&gt; 6\n   p b.curry[1, 2][3, 4]        #=&gt; wrong number of arguments (4 or 3)\n   p b.curry(5)                 #=&gt; wrong number of arguments (5 or 3)\n   p b.curry(1)                 #=&gt; wrong number of arguments (1 or 3)\n\n   b = lambda {|x, y, z, *w| (x||0) + (y||0) + (z||0) + w.inject(0, &amp;:+) }\n   p b.curry[1][2][3]           #=&gt; 6\n   p b.curry[1, 2][3, 4]        #=&gt; 10\n   p b.curry(5)[1][2][3][4][5]  #=&gt; 15\n   p b.curry(5)[1, 2][3, 4][5]  #=&gt; 15\n   p b.curry(1)                 #=&gt; wrong number of arguments (1 or 3)\n\n   b = proc { :foo }\n   p b.curry[]                  #=&gt; :foo\n"
full_name: Proc#curry
is_singleton: false
name: curry
params: |
  prc.curry         => a_proc
  prc.curry(arity)  => a_proc

visibility: public
