Class: ISO8601::Seconds
- Inherits:
-
Object
- Object
- ISO8601::Seconds
- Includes:
- Atomic
- Defined in:
- lib/iso8601/seconds.rb
Overview
The Seconds atom in a Duration
The second is the base unit of measurement of time in the International System of Units (SI) as defined by the International Committee of Weights and Measures.
Constant Summary collapse
- AVERAGE_FACTOR =
1
Instance Attribute Summary
Attributes included from Atomic
Instance Method Summary collapse
-
#factor ⇒ Numeric
The Second factor.
-
#initialize(atom) ⇒ Seconds
constructor
A new instance of Seconds.
-
#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) ⇒ Seconds
Returns a new instance of Seconds.
17 18 19 20 21 |
# File 'lib/iso8601/seconds.rb', line 17 def initialize(atom) valid_atom?(atom) @atom = atom end |
Instance Method Details
#factor ⇒ Numeric
The Second factor
27 28 29 |
# File 'lib/iso8601/seconds.rb', line 27 def factor AVERAGE_FACTOR end |
#symbol ⇒ Symbol
The atom symbol.
43 44 45 |
# File 'lib/iso8601/seconds.rb', line 43 def symbol :S end |
#to_seconds ⇒ Numeric
The amount of seconds
35 36 37 |
# File 'lib/iso8601/seconds.rb', line 35 def to_seconds atom end |