aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/mauve_time.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mauve/mauve_time.rb')
-rw-r--r--lib/mauve/mauve_time.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/mauve/mauve_time.rb b/lib/mauve/mauve_time.rb
index d2949d9..f564fdb 100644
--- a/lib/mauve/mauve_time.rb
+++ b/lib/mauve/mauve_time.rb
@@ -34,11 +34,15 @@ class Time
# @return [Time]
#
def in_x_hours(n, type="wallclock")
+ raise ArgumentError, "n must be numeric" unless n.is_a?(Numeric)
+ raise ArgumentError, "type must be a string" unless type.is_a?(String)
+
t = self.dup
+
#
# Do this in seconds rather than hours
#
- n = n.to_i*3600
+ n = (n*3600).to_i
test = case type
when "working"