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.
5 6 7 8 |
# File 'lib/chronic/repeaters/repeater_time.rb', line 5 def initialize(time, ambiguous = false) @time = time @ambiguous = ambiguous end |
Instance Attribute Details
#time ⇒ Object
Returns the value of attribute time.
3 4 5 |
# File 'lib/chronic/repeaters/repeater_time.rb', line 3 def time @time end |
Instance Method Details
#*(other) ⇒ Object
14 15 16 |
# File 'lib/chronic/repeaters/repeater_time.rb', line 14 def *(other) Tick.new(@time * other, @ambiguous) end |
#ambiguous? ⇒ Boolean
10 11 12 |
# File 'lib/chronic/repeaters/repeater_time.rb', line 10 def ambiguous? @ambiguous end |
#to_f ⇒ Object
18 19 20 |
# File 'lib/chronic/repeaters/repeater_time.rb', line 18 def to_f @time.to_f end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/chronic/repeaters/repeater_time.rb', line 22 def to_s @time.to_s + (@ambiguous ? '?' : '') end |