Created
May 1, 2010 03:04
-
-
Save njonsson/386009 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
rich_tevye = Tevye.new | |
def rich_tevye.rich_man? | |
true | |
end | |
result = catch(:miracle_of_miracles) do | |
rich_tevye.live | |
end |
This file contains hidden or 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 Tevye | |
def live | |
sunrise | |
sunset | |
l_chaim! | |
toil_in_anatevka | |
:pauper | |
end | |
def rich_man? | |
false | |
end | |
private | |
def method_missing(method, *args) | |
nil | |
end | |
def toil_in_anatevka | |
if self.rich_man? | |
throw :miracle_of_miracles, 'Emigrated to the Cayman Islands' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment