Skip to content

Instantly share code, notes, and snippets.

@gnufied
Created July 8, 2013 13:20
Show Gist options
  • Save gnufied/5948718 to your computer and use it in GitHub Desktop.
Save gnufied/5948718 to your computer and use it in GitHub Desktop.
class Foo
def hello &block
instance_eval &block
end
end
a = 10
b = Foo.new()
b.hello { |c|
puts a
}
#=> 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment