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.
11 12 13 14 15 |
# File 'lib/iso8601/weeks.rb', line 11 def initialize(atom) valid_atom?(atom) @atom = atom end |
Instance Method Details
#factor ⇒ Numeric
The Week factor
21 22 23 |
# File 'lib/iso8601/weeks.rb', line 21 def factor AVERAGE_FACTOR end |
#symbol ⇒ Symbol
The atom symbol.
37 38 39 |
# File 'lib/iso8601/weeks.rb', line 37 def symbol :W end |
#to_seconds ⇒ Numeric
The amount of seconds
29 30 31 |
# File 'lib/iso8601/weeks.rb', line 29 def to_seconds AVERAGE_FACTOR * atom end |