Created
January 20, 2011 16:02
-
-
Save jeffmcfadden/788098 to your computer and use it in GitHub Desktop.
It's a Peter
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 Peter | |
def isTired? | |
hadClassToday? && Time.now.hour > 22 | |
end | |
def hadClassToday? | |
true unless ( Time.now.wday == 0 || Time.now.wday == 6 ) | |
end | |
def status | |
if self.isTired? | |
"zzz" | |
else | |
"O_o" | |
end | |
end | |
end | |
> peter = Peter.new | |
> peter.isTired? | |
=> true | |
> peter.status | |
=> "zzz" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment