Skip to content

Instantly share code, notes, and snippets.

@jeffmcfadden
Created January 20, 2011 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffmcfadden/788098 to your computer and use it in GitHub Desktop.
Save jeffmcfadden/788098 to your computer and use it in GitHub Desktop.
It's a Peter
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