Type:
Class

Proc objects are blocks of code that have been bound to a set of local variables. Once bound, the code may be called in different contexts and still access those variables.

def gen_times(factor)
  return Proc.new {|n| n*factor }
end

times3 = gen_times(3)
times5 = gen_times(5)

times3.call(12)               #=> 36
times5.call(5)                #=> 25
times3.call(times5.call(4))   #=> 60
curry

prc.curry â a_procprc.curry(arity) â a_proc Instance Public methods Returns

2015-04-28 15:31:51
parameters

prc.parameters â array Instance Public methods Returns the parameter information

2015-04-28 15:50:41
new

Proc.new {|...| block } â a_procProc.new â a_proc Class Public methods

2015-04-28 15:14:08
source_location

prc.source_location â [String, Fixnum] Instance Public methods Returns the

2015-04-28 15:56:52
call

prc.call(params,...) â obj Instance Public methods Invokes the block, setting

2015-04-28 15:31:04