Plain-English convenience methods module designed for the Numeric class.

Methods
Public Instance methods
after(time = ::Time.now) [ source ]

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

This method is also aliased as since from_now later
ago(time = ::Time.now)

Alias for before

before(time = ::Time.now) [ source ]

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

This method is also aliased as until ago
day()

Alias for days

days() [ source ]

Converts days into seconds.

This method is also aliased as day
fortnight()

Alias for fortnights

fortnights() [ source ]

Converts fortnights into seconds. (A fortnight is 2 weeks)

This method is also aliased as fortnight
from_now(time = ::Time.now)

Alias for after

hour()

Alias for hours

hours() [ source ]

Converts hours into seconds.

This method is also aliased as hour
later(time = ::Time.now)

Alias for after

minute()

Alias for minutes

minutes() [ source ]

Converts minutes into seconds.

This method is also aliased as minute
month()

Alias for months

months() [ source ]

Converts months into seconds. WARNING: This is not exact as it assumes 30 days to a month.

This method is also aliased as month
second()

Alias for seconds

seconds() [ source ]

Enables the use of time calculations and declarations, like 45.minutes + 2.hours + 4.years. The base unit for all of these Numeric time methods is seconds.

This method is also aliased as second
since(time = ::Time.now)

Alias for after

until(time = ::Time.now)

Alias for before

week()

Alias for weeks

weeks() [ source ]

Converts weeks into seconds.

This method is also aliased as week
year()

Alias for years

years() [ source ]

Converts years into seconds.

This method is also aliased as year