Class: Runby::RunbyRange
- Inherits:
-
Object
- Object
- Runby::RunbyRange
- Defined in:
- lib/runby_pace/runby_range.rb
Overview
Base class for ranges of Runby data, e.g. PaceRange, SpeedRange, …
Direct Known Subclasses
Instance Attribute Summary collapse
-
#fast ⇒ Object
readonly
Returns the value of attribute fast.
-
#slow ⇒ Object
readonly
Returns the value of attribute slow.
Instance Method Summary collapse
-
#initialize ⇒ RunbyRange
constructor
A new instance of RunbyRange.
- #to_s(format: :short) ⇒ Object
Constructor Details
#initialize ⇒ RunbyRange
Returns a new instance of RunbyRange.
8 9 10 11 12 |
# File 'lib/runby_pace/runby_range.rb', line 8 def initialize @fast = nil @slow = nil raise 'RunbyRange is a base class for PaceRange and SpeedRange. Instantiate one of them instead.' end |
Instance Attribute Details
#fast ⇒ Object (readonly)
Returns the value of attribute fast.
6 7 8 |
# File 'lib/runby_pace/runby_range.rb', line 6 def fast @fast end |
#slow ⇒ Object (readonly)
Returns the value of attribute slow.
6 7 8 |
# File 'lib/runby_pace/runby_range.rb', line 6 def slow @slow end |
Instance Method Details
#to_s(format: :short) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/runby_pace/runby_range.rb', line 14 def to_s(format: :short) if @fast == @slow @fast.to_s(format: format) else "#{@fast}-#{@slow}" end end |