Class: ISO8601::Weeks
Overview
A Weeks atom in a Duration
Constant Summary collapse
- AVERAGE_FACTOR =
604800
Instance Attribute Summary
Attributes included from Atomic
Instance Method Summary collapse
-
#factor ⇒ Numeric
The Week factor.
-
#initialize(atom) ⇒ Weeks
constructor
A new instance of Weeks.
-
#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) ⇒ Weeks
Returns a new instance of Weeks.
13 14 15 16 17 |
# File 'lib/iso8601/weeks.rb', line 13 def initialize(atom) valid_atom?(atom) @atom = atom end |
Instance Method Details
#factor ⇒ Numeric
The Week factor
23 24 25 |
# File 'lib/iso8601/weeks.rb', line 23 def factor AVERAGE_FACTOR end |
#symbol ⇒ Symbol
The atom symbol.
39 40 41 |
# File 'lib/iso8601/weeks.rb', line 39 def symbol :W end |
#to_seconds ⇒ Numeric
The amount of seconds
31 32 33 |
# File 'lib/iso8601/weeks.rb', line 31 def to_seconds AVERAGE_FACTOR * atom end |