method

new

Importance_1
Ruby latest stable (v1_8_7_72) - 0 notes - Class: Proc
new(...) public

Creates a new Proc object, bound to the current context. Proc::new may be called without a block only within a method with an attached block, in which case that block is converted to the Proc object.

   def proc_from
     Proc.new
   end
   proc = proc_from { "hello" }
   proc.call   #=> "hello"
Show source
Register or log in to add new notes.