Module: TimeUnits

Defined in:
lib/time_units/units.rb,
lib/time_units/version.rb

Constant Summary collapse

VERSION =
"0.2.0"

Instance Method Summary collapse

Instance Method Details

#agoObject



11
# File 'lib/time_units/units.rb', line 11

def ago; Time.now - seconds; end

#daysObject



6
# File 'lib/time_units/units.rb', line 6

def days()    24 * hours end

#from_nowObject



12
# File 'lib/time_units/units.rb', line 12

def from_now; Time.now + seconds; end

#hoursObject



5
# File 'lib/time_units/units.rb', line 5

def hours()   60 * minutes end

#minutesObject



4
# File 'lib/time_units/units.rb', line 4

def minutes() 60 * seconds end

#monthsObject



8
# File 'lib/time_units/units.rb', line 8

def months()  4* weeks end

#secondsObject



3
# File 'lib/time_units/units.rb', line 3

def seconds() self end

#weeksObject



7
# File 'lib/time_units/units.rb', line 7

def weeks()   7 * days end

#yearsObject



9
# File 'lib/time_units/units.rb', line 9

def years()   365 * days end