Module: Assistance::TimeCalculations

### Home Classes Methods

### In Files

- lib/assistance/time_calculations.rb

### Methods

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

### Files

- CHANGELOG
- COPYING
- README

### Class/Module Index

Quicksearch

- Validation
- Validation::ClassMethods
- Validation::Errors
- Validation::Generator
- Assistance
- Assistance::TimeCalculations
- Inflector
- Inflector::Inflections
- Array
- ConnectionPool
- FalseClass
- NilClass
- Numeric
- Object
- SingleThreadedPool
- String
- TrueClass

No matching classes.

# Assistance::TimeCalculations

### Constants

DAY
HOUR
MINUTE
WEEK

### Public Instance Methods

ago(t = Time.now) click to toggle source

Returns the time at now - self.

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

Also aliased as: before
before(t = Time.now) click to toggle source
Alias for: ago
day() click to toggle source
Alias for: days
days() click to toggle source

Converts self from days to seconds

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

Also aliased as: day
from_now(t = Time.now) click to toggle source

Returns the time at now + self.

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

Also aliased as: since
hour() click to toggle source
Alias for: hours
hours() click to toggle source

Converts self from hours to seconds

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

Also aliased as: hour
minute() click to toggle source
Alias for: minutes
minutes() click to toggle source

Converts self from minutes to seconds

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

Also aliased as: minute
since(t = Time.now) click to toggle source
Alias for: from_now
week() click to toggle source
Alias for: weeks
weeks() click to toggle source

Converts self from weeks to seconds

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

Also aliased as: week

[Validate]

Generated with the Darkfish Rdoc Generator 2.