Class: Duration::Months
- Inherits:
-
Object
- Object
- Duration::Months
- Defined in:
- lib/Duration/Months.rb
Overview
A month is not a fixed quantity: its length depends on the calendar. The conversions below use the Gregorian mean month (2629746 seconds), so they are honest only as a statistical average, never as calendar-correct arithmetic. For that, reach for a calendar-anchored type such as month.rb.
ago and hence (via Relative) inherit the same caveat: they displace by the mean month rather than an actual calendar month, so they are approximate, not calendar-correct. Months is slated for removal in 0.5.0.
Instance Method Summary collapse
- #to_days ⇒ Object
- #to_f ⇒ Object
- #to_hours ⇒ Object
- #to_i ⇒ Object
- #to_microseconds ⇒ Object
- #to_milliseconds ⇒ Object
- #to_minutes ⇒ Object
- #to_months ⇒ Object
- #to_nanoseconds ⇒ Object
- #to_seconds ⇒ Object
- #to_weeks ⇒ Object
Methods included from Relative
Methods included from Common
Instance Method Details
#to_days ⇒ Object
43 44 45 |
# File 'lib/Duration/Months.rb', line 43 def to_days to_weeks.to_days end |
#to_f ⇒ Object
60 61 62 |
# File 'lib/Duration/Months.rb', line 60 def to_f @months.to_f end |
#to_hours ⇒ Object
39 40 41 |
# File 'lib/Duration/Months.rb', line 39 def to_hours to_weeks.to_hours end |
#to_i ⇒ Object
56 57 58 |
# File 'lib/Duration/Months.rb', line 56 def to_i @months.to_i end |
#to_microseconds ⇒ Object
23 24 25 |
# File 'lib/Duration/Months.rb', line 23 def to_microseconds to_weeks.to_microseconds end |
#to_milliseconds ⇒ Object
27 28 29 |
# File 'lib/Duration/Months.rb', line 27 def to_milliseconds to_weeks.to_milliseconds end |
#to_minutes ⇒ Object
35 36 37 |
# File 'lib/Duration/Months.rb', line 35 def to_minutes to_weeks.to_minutes end |
#to_months ⇒ Object
52 53 54 |
# File 'lib/Duration/Months.rb', line 52 def to_months self end |
#to_nanoseconds ⇒ Object
19 20 21 |
# File 'lib/Duration/Months.rb', line 19 def to_nanoseconds to_weeks.to_nanoseconds end |
#to_seconds ⇒ Object
31 32 33 |
# File 'lib/Duration/Months.rb', line 31 def to_seconds to_weeks.to_seconds end |