method

lambda

Importance_1
Ruby latest stable (v1_8_7_72) - 1 note - Class: Kernel
lambda() public

Equivalent to Proc.new, except the resulting Proc objects check the number of parameters passed when called.

Show source
Register or log in to add new notes.
July 16, 2009
0 thanks

Usage example

Usage example:

  cube = lambda {|x| x * x * x }
  cube.call(3)  # => 27
  cube.call(6)  # => 216