class Xronor::DSL::NumericSeconds
Public Class Methods
new(number)
click to toggle source
# File lib/xronor/dsl/numeric_seconds.rb, line 35 def initialize(number) @number = number.to_i end
seconds(number, units)
click to toggle source
# File lib/xronor/dsl/numeric_seconds.rb, line 31 def self.seconds(number, units) self.new(number).send(units) end
Public Instance Methods
days()
click to toggle source
# File lib/xronor/dsl/numeric_seconds.rb, line 54 def days @number * 60 * 60 * 24 end
Also aliased as: day
hours()
click to toggle source
# File lib/xronor/dsl/numeric_seconds.rb, line 49 def hours @number * 60 * 60 end
Also aliased as: hour
minutes()
click to toggle source
# File lib/xronor/dsl/numeric_seconds.rb, line 44 def minutes @number * 60 end
Also aliased as: minute
months()
click to toggle source
# File lib/xronor/dsl/numeric_seconds.rb, line 64 def months @number * 60 * 60 * 24 * 30 end
Also aliased as: month
seconds()
click to toggle source
# File lib/xronor/dsl/numeric_seconds.rb, line 39 def seconds @number end
Also aliased as: second
weeks()
click to toggle source
# File lib/xronor/dsl/numeric_seconds.rb, line 59 def weeks @number * 60 * 60 * 24 * 7 end
Also aliased as: week
years()
click to toggle source
# File lib/xronor/dsl/numeric_seconds.rb, line 69 def years @number * 60 * 60 * 24 * 365 + 60 * 60 * 6 # consider leap year end
Also aliased as: year