Top "Proc-object" questions

Using 'return' in a Ruby block

I'm trying to use Ruby 1.9.1 for an embedded scripting language, so that "end-user" code gets written in a Ruby block. …

ruby lambda return proc-object
Ruby - lambda vs. Proc.new

Possible Duplicate: What's the difference between a proc and a lambda in Ruby? When run this Ruby code: def func_…

ruby lambda return proc-object
TCL - how to know how much time a function has worked?

Say I have a proc and the proc consists of several statements and function calls. How I can know how …

time timestamp tcl proc-object
Why does explicit return make a difference in a Proc?

def foo f = Proc.new { return "return from foo from inside proc" } f.call # control leaves foo here return "return …

ruby return proc-object
How to pass parameters to a proc when calling it by a method?

proc = Proc.new do |name| puts "Thank you #{name}!" end def thank yield end proc.call # output nothing, just fine …

ruby parameters call block proc-object
Why use Proc.new to call a method in a Rails callback?

in all the tutorials for RoR I see instances where the coder chose to use Proc.new when seemingly it …

ruby-on-rails ruby proc-object
Ruby block, procs and instance_eval

I recently tried to do something akin to this: a = "some string" b = Proc.new{ upcase } a.instance_eval b …

ruby block lambda proc-object