Created
October 9, 2008 09:02
-
-
Save benhoskings/15728 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Lol | |
def where_am_i | |
"within #{self.class.to_s}" | |
end | |
def winproc | |
proc { "lol from #{where_am_i}" } | |
end | |
end | |
def where_am_i | |
'top level' | |
end | |
lol = Lol.new | |
puts lol.winproc.call | |
puts binding.instance_exec &lol.winproc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment