Class: ISO8601::Months
Overview
A Months atom in a Duration
A “calendar month” is the time interval resulting from the division of a “calendar year” in 12 time intervals.
A “duration month” is the duration of 28, 29, 30 or 31 “calendar days” depending on the start and/or the end of the corresponding time interval within the specific “calendar month”.
Instance Attribute Summary
Attributes inherited from Atom
Instance Method Summary collapse
-
#factor ⇒ Object
The Month factor.
-
#symbol ⇒ Symbol
The atom symbol.
Methods inherited from Atom
#==, #eql?, #hash, #initialize, #to_f, #to_i, #to_s, #to_seconds, #value
Constructor Details
This class inherits a constructor from ISO8601::Atom
Instance Method Details
#factor ⇒ Object
The Month factor
The “duration month” average is calculated through time intervals of 400 “duration years”. Each cycle of 400 “duration years” has 303 “common years” of 365 “calendar days” and 97 “leap years” of 366 “calendar days”.
137 138 139 140 141 142 143 144 145 |
# File 'lib/iso8601/atoms.rb', line 137 def factor if base.nil? nobase_calculation elsif atom.zero? zero_calculation else calculation end end |
#symbol ⇒ Symbol
The atom symbol.
150 151 152 |
# File 'lib/iso8601/atoms.rb', line 150 def symbol :M end |