Created
September 4, 2009 08:31
-
-
Save anonymous/180794 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
def do_something | |
action = case self | |
when self.play?: true ? 'play football' : 'do nothing' | |
when self.work?: 'go to work' | |
when self.sleep?: 'sleep' | |
else: 'What?' | |
end | |
return action | |
end | |
def play?; false; end | |
def work?; true; end | |
def sleep?; false; end | |
object.do_something --> "What?" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment