Created
April 14, 2009 20:44
-
-
Save mattly/95415 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
class Time | |
# because i often times have trouble keeping these straight | |
# >> 1.day.ago.before? Time.now | |
# => true | |
# >> 1.day.from_now.before? Time.now | |
# => false | |
# >> 1.day.from_now.after? Time.now | |
# => true | |
# >> 1.day.ago.after? Time.now | |
# => false | |
def before? other | |
self < other | |
end | |
def after? other | |
self > other | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment