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
45 46 47 |
# File 'lib/Duration/Months.rb', line 45 def to_days to_weeks.to_days end |
#to_f ⇒ Object
62 63 64 |
# File 'lib/Duration/Months.rb', line 62 def to_f @months.to_f end |
#to_hours ⇒ Object
41 42 43 |
# File 'lib/Duration/Months.rb', line 41 def to_hours to_weeks.to_hours end |
#to_i ⇒ Object
58 59 60 |
# File 'lib/Duration/Months.rb', line 58 def to_i @months.to_i end |
#to_microseconds ⇒ Object
25 26 27 |
# File 'lib/Duration/Months.rb', line 25 def to_microseconds to_weeks.to_microseconds end |
#to_milliseconds ⇒ Object
29 30 31 |
# File 'lib/Duration/Months.rb', line 29 def to_milliseconds to_weeks.to_milliseconds end |
#to_minutes ⇒ Object
37 38 39 |
# File 'lib/Duration/Months.rb', line 37 def to_minutes to_weeks.to_minutes end |
#to_months ⇒ Object
54 55 56 |
# File 'lib/Duration/Months.rb', line 54 def to_months self end |
#to_nanoseconds ⇒ Object
21 22 23 |
# File 'lib/Duration/Months.rb', line 21 def to_nanoseconds to_weeks.to_nanoseconds end |
#to_seconds ⇒ Object
33 34 35 |
# File 'lib/Duration/Months.rb', line 33 def to_seconds to_weeks.to_seconds end |