Class: ISO8601::Days
Overview
The Days atom in a Duration
A “calendar day” is the time interval which starts at a certain time of day at a certain “calendar day” and ends at the same time of day at the next “calendar day”.
Constant Summary collapse
- AVERAGE_FACTOR =
86400
Instance Attribute Summary
Attributes included from Atomic
Instance Method Summary collapse
-
#factor ⇒ Numeric
The Day factor.
-
#initialize(atom) ⇒ Days
constructor
A new instance of Days.
-
#symbol ⇒ Symbol
The atom symbol.
-
#to_seconds ⇒ Numeric
The amount of seconds.
Methods included from Atomic
#<=>, #eql?, #hash, #to_f, #to_i, #to_s, #valid_atom?, #valid_base?, #value
Constructor Details
#initialize(atom) ⇒ Days
Returns a new instance of Days.
17 18 19 20 21 |
# File 'lib/iso8601/days.rb', line 17 def initialize(atom) valid_atom?(atom) @atom = atom end |
Instance Method Details
#factor ⇒ Numeric
The Day factor
27 28 29 |
# File 'lib/iso8601/days.rb', line 27 def factor AVERAGE_FACTOR end |
#symbol ⇒ Symbol
The atom symbol.
43 44 45 |
# File 'lib/iso8601/days.rb', line 43 def symbol :D end |
#to_seconds ⇒ Numeric
The amount of seconds
35 36 37 |
# File 'lib/iso8601/days.rb', line 35 def to_seconds AVERAGE_FACTOR * atom end |