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
- #ago ⇒ Object
- #days ⇒ Object
- #from_now ⇒ Object
- #hours ⇒ Object
- #minutes ⇒ Object
- #months ⇒ Object
- #seconds ⇒ Object
- #weeks ⇒ Object
- #years ⇒ Object
Instance Method Details
#ago ⇒ Object
11 |
# File 'lib/time_units/units.rb', line 11 def ago; Time.now - seconds; end |
#days ⇒ Object
6 |
# File 'lib/time_units/units.rb', line 6 def days() 24 * hours end |
#from_now ⇒ Object
12 |
# File 'lib/time_units/units.rb', line 12 def from_now; Time.now + seconds; end |
#hours ⇒ Object
5 |
# File 'lib/time_units/units.rb', line 5 def hours() 60 * minutes end |
#minutes ⇒ Object
4 |
# File 'lib/time_units/units.rb', line 4 def minutes() 60 * seconds end |
#months ⇒ Object
8 |
# File 'lib/time_units/units.rb', line 8 def months() 4* weeks end |
#seconds ⇒ Object
3 |
# File 'lib/time_units/units.rb', line 3 def seconds() self end |
#weeks ⇒ Object
7 |
# File 'lib/time_units/units.rb', line 7 def weeks() 7 * days end |
#years ⇒ Object
9 |
# File 'lib/time_units/units.rb', line 9 def years() 365 * days end |