aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/mauve_time.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-08-10 13:54:53 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-08-10 13:54:53 +0100
commit8621a1b4914f70975f83ad59d31da25d5c01aa1a (patch)
tree2ff85276016c2ccf22ea618ef0417226bbb29d59 /lib/mauve/mauve_time.rb
parentd650c2dad3ae58caeebb598e7624e80ee2a4b71a (diff)
Updated during_runner to work better.
--HG-- rename : test/time_test.rb => test/tc_mauve_time.rb
Diffstat (limited to 'lib/mauve/mauve_time.rb')
-rw-r--r--lib/mauve/mauve_time.rb15
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)