Module: Assistance::TimeCalculations

Module | Assistance::TimeCalculations
In: | lib/assistance/time_calculations.rb

### Methods

ago before day days from_now hour hours minute minutes since week weeks

### Constants

MINUTE | = | 60
HOUR | = | 3600
DAY | = | 86400
WEEK | = | DAY * 7

### Public Instance methods

ago(t = Time.now)

Returns the time at now - self.

[Source]

        # File lib/assistance/time_calculations.rb, line 23
    23:     def ago(t = Time.now); t - self; end

before(t = Time.now)

Alias for ago

day()

Alias for days

days()

Converts self from days to seconds

[Source]

        # File lib/assistance/time_calculations.rb, line 18
    18:     def days;     self * DAY;     end

from_now(t = Time.now)

Returns the time at now + self.

[Source]

        # File lib/assistance/time_calculations.rb, line 27
    27:     def from_now(t = Time.now); t + self; end

hour()

Alias for hours

hours()

Converts self from hours to seconds

[Source]

        # File lib/assistance/time_calculations.rb, line 16
    16:     def hours;    self * HOUR;    end

minute()

Alias for minutes

minutes()

Converts self from minutes to seconds

[Source]

        # File lib/assistance/time_calculations.rb, line 14
    14:     def minutes;  self * MINUTE;  end

since(t = Time.now)

Alias for from_now

week()

Alias for weeks

weeks()

Converts self from weeks to seconds

[Source]

        # File lib/assistance/time_calculations.rb, line 20
    20:     def weeks;    self * WEEK;    end

[Validate]