Class: RunbyPace::RunbyRange

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

Direct Known Subclasses

PaceRange, SpeedRange

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ RunbyRange

Returns a new instance of RunbyRange.



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

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.



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

def fast
  @fast
end

#slow ⇒ Object (readonly)

Returns the value of attribute slow.



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

def slow
  @slow
end

Instance Method Details

#to_s ⇒ Object



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

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