Skip to content

Instantly share code, notes, and snippets.

@maxim
Created February 12, 2012 19:59
Show Gist options
  • Save maxim/1810525 to your computer and use it in GitHub Desktop.
Save maxim/1810525 to your computer and use it in GitHub Desktop.
>> foo = proc { bar }
=> #<Proc:0x0000000101c444b8@(pry):1>
>> foo.call
NameError: undefined local variable or method `bar' for #<Object:0x1001dc288>
from (pry):1
>> def bar
>> "bar"
>> end
=> nil
>> foo.call
=> "bar"
>> class Baz
>> def bar
>> "baz"
>> end
>> end
=> nil
>> Baz.new.instance_eval(&foo)
=> "baz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment