module RichUnits::Times::Numeric

Numeric Times

Public Instance Methods

after(time = ::Time.now) click to toggle source

Calculates time after a given time. Default time is now. Reads best with argument: 10.minutes.after(time)

# File lib/richunits/times.rb, line 434
def after(time = ::Time.now)
  time + self
end
Also aliased as: since, hence, from_now, later
ago(time = ::Time.now)
Alias for: before
before(time = ::Time.now) click to toggle source

Calculates time before a given time. Default time is now. Reads best with arguments: 10.days.before( Time.now - 1.day )

# File lib/richunits/times.rb, line 426
def before(time = ::Time.now)
  time - self
end
Also aliased as: until, ago
from_now(time = ::Time.now)
Alias for: after
hence(time = ::Time.now)
Alias for: after
later(time = ::Time.now)
Alias for: after
since(time = ::Time.now)
Alias for: after
until(time = ::Time.now)
Alias for: before