Skip to content

Instantly share code, notes, and snippets.

@benlangfeld
Created December 1, 2011 23:36
Show Gist options
  • Save benlangfeld/1420715 to your computer and use it in GitHub Desktop.
Save benlangfeld/1420715 to your computer and use it in GitHub Desktop.
class Foo
def foo(&block)
instance_eval &block
end
def bar(&block)
yield
end
end
Foo.new.foo do
p self
end
Foo.new.bar do |foo|
p foo
p self
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment