Class: Runby::RunbyRange

Inherits:
Object
  • Object
show all
Defined in:
lib/runby_pace/runby_range.rb

Overview

Base class for ranges of Runby data, e.g. PaceRange, SpeedRange, …

Direct Known Subclasses

PaceRange, SpeedRange

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRunbyRange

Returns a new instance of RunbyRange.



6
7
8
9
10
# File 'lib/runby_pace/runby_range.rb', line 6

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

#fastObject (readonly)

Returns the value of attribute fast.



4
5
6
# File 'lib/runby_pace/runby_range.rb', line 4

def fast
  @fast
end

#slowObject (readonly)

Returns the value of attribute slow.



4
5
6
# File 'lib/runby_pace/runby_range.rb', line 4

def slow
  @slow
end

Instance Method Details

#to_sObject



12
13
14
15
16
17
18
# File 'lib/runby_pace/runby_range.rb', line 12

def to_s
  if @fast == @slow
    @fast.to_s
  else
    "#{@fast}-#{@slow}"
  end
end