Created
February 16, 2010 20:15
-
-
Save adriand/305860 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
# given hash like { :weeks => 1 } or { :months => -2 }, always return hash with a negative value | |
def past(interval) | |
k,v = interval.to_a[0] | |
interval[k] = v.abs * -1 | |
interval | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment