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

day()
Alias for: days
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
hour()
Alias for: hours
hours() click to toggle source
# File lib/xronor/dsl/numeric_seconds.rb, line 49
def hours
  @number * 60 * 60
end
Also aliased as: hour
minute()
Alias for: minutes
minutes() click to toggle source
# File lib/xronor/dsl/numeric_seconds.rb, line 44
def minutes
  @number * 60
end
Also aliased as: minute
month()
Alias for: months
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
second()
Alias for: seconds
seconds() click to toggle source
# File lib/xronor/dsl/numeric_seconds.rb, line 39
def seconds
  @number
end
Also aliased as: second
week()
Alias for: weeks
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
year()
Alias for: years
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