diff options
Diffstat (limited to 'lib/mauve/mauve_time.rb')
-rw-r--r-- | lib/mauve/mauve_time.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/mauve/mauve_time.rb b/lib/mauve/mauve_time.rb index 812b0e2..e51cf6d 100644 --- a/lib/mauve/mauve_time.rb +++ b/lib/mauve/mauve_time.rb @@ -1,6 +1,21 @@ require 'date' require 'time' + +# Seconds, minutes, hours, days, and weeks... More than that, we +# really should not need it. +class Integer + def seconds; self; end + def minutes; self*60; end + def hours; self*3600; end + def days; self*86400; end + def weeks; self*604800; end + alias_method :day, :days + alias_method :hour, :hours + alias_method :minute, :minutes + alias_method :week, :weeks +end + class Date def to_mauvetime Mauve::MauveTime.parse(self.to_s) |