From 8621a1b4914f70975f83ad59d31da25d5c01aa1a Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Wed, 10 Aug 2011 13:54:53 +0100 Subject: Updated during_runner to work better. --HG-- rename : test/time_test.rb => test/tc_mauve_time.rb --- lib/mauve/mauve_time.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/mauve/mauve_time.rb') 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) -- cgit v1.2.1