Module: TimeDSL

Module | TimeDSL
In: | lib/merb-helpers/time_dsl.rb

Provides a a simple way of calling time units and to see the elapsed time between 2 moments

#### Examples

      142.minutes => returns a value in seconds
      7.days => returns a value in seconds
      1.week => returns a value in seconds
      2.weeks.ago => returns a date
      1.year.since(time) => returns a date
      5.months.since(2.weeks.from_now) => returns a date

### Methods

ago day days from_now hour hours minute minutes month months second seconds since until week weeks year years

### Public Instance methods

ago(time = ::Time.now)

Reads best without arguments: 10.minutes.ago

day()
days()

Alias for day

from_now(time = ::Time.now)

Alias for since

hour()
hours()

Alias for hour

minute()
minutes()

Alias for minute

month()
months()

Alias for month

second()
seconds()

Alias for second

since(time = ::Time.now)

Reads best with argument: 10.minutes.since(time)

until(time = ::Time.now)

Alias for ago

week()
weeks()

Alias for week

year()
years()

Alias for year

[Validate]