Class: Chronic::RepeaterTime::Tick
- Inherits:
-
Object
- Object
- Chronic::RepeaterTime::Tick
- Defined in:
- lib/chronic/repeaters/repeater_time.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
- #*(other) ⇒ Object
- #ambiguous? ⇒ Boolean
-
#initialize(time, ambiguous = false) ⇒ Tick
constructor
A new instance of Tick.
- #to_f ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(time, ambiguous = false) ⇒ Tick
Returns a new instance of Tick.
6 7 8 9 |
# File 'lib/chronic/repeaters/repeater_time.rb', line 6 def initialize(time, ambiguous = false) @time = time @ambiguous = ambiguous end |
Instance Attribute Details
#time ⇒ Object
Returns the value of attribute time.
4 5 6 |
# File 'lib/chronic/repeaters/repeater_time.rb', line 4 def time @time end |
Instance Method Details
#*(other) ⇒ Object
15 16 17 |
# File 'lib/chronic/repeaters/repeater_time.rb', line 15 def *(other) Tick.new(@time * other, @ambiguous) end |
#ambiguous? ⇒ Boolean
11 12 13 |
# File 'lib/chronic/repeaters/repeater_time.rb', line 11 def ambiguous? @ambiguous end |
#to_f ⇒ Object
19 20 21 |
# File 'lib/chronic/repeaters/repeater_time.rb', line 19 def to_f @time.to_f end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/chronic/repeaters/repeater_time.rb', line 23 def to_s @time.to_s + (@ambiguous ? '?' : '') end |