new

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

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"
doc_ruby_on_rails
2015-04-28 15:14:08
Comments
Leave a Comment

Please login to continue.