Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/numeric.rb
Constant Summary collapse
- SECONDS_PER_MINUTE =
60.0
- SECONDS_PER_HOUR =
SECONDS_PER_MINUTE * 60
- SECONDS_PER_DAY =
SECONDS_PER_HOUR * 24
- SECONDS_PER_WEEK =
SECONDS_PER_DAY * 7
- SECONDS_PER_MONTH =
SECONDS_PER_DAY * 30
- SECONDS_PER_YEAR =
SECONDS_PER_DAY * 365.25
Instance Method Summary collapse
- #days ⇒ Object (also: #day)
- #hours ⇒ Object (also: #hour)
- #minutes ⇒ Object (also: #minute)
- #months ⇒ Object (also: #month)
- #seconds ⇒ Object (also: #second)
- #weeks ⇒ Object (also: #week)
- #years ⇒ Object (also: #year)
Instance Method Details
#days ⇒ Object Also known as: day
24 25 26 |
# File 'lib/numeric.rb', line 24 def days self * SECONDS_PER_DAY end |
#hours ⇒ Object Also known as: hour
29 30 31 |
# File 'lib/numeric.rb', line 29 def hours self * SECONDS_PER_HOUR end |
#minutes ⇒ Object Also known as: minute
34 35 36 |
# File 'lib/numeric.rb', line 34 def minutes self * SECONDS_PER_MINUTE end |
#months ⇒ Object Also known as: month
14 15 16 |
# File 'lib/numeric.rb', line 14 def months self * SECONDS_PER_MONTH end |
#seconds ⇒ Object Also known as: second
39 40 41 |
# File 'lib/numeric.rb', line 39 def seconds self end |
#weeks ⇒ Object Also known as: week
19 20 21 |
# File 'lib/numeric.rb', line 19 def weeks self * SECONDS_PER_WEEK end |
#years ⇒ Object Also known as: year
9 10 11 |
# File 'lib/numeric.rb', line 9 def years self * SECONDS_PER_YEAR end |