Class: RunbyPace::SpeedRange

Inherits:
RunbyRange show all
Defined in:
lib/runby_pace/speed_range.rb

Instance Attribute Summary

Attributes inherited from RunbyRange

#fast, #slow

Instance Method Summary collapse

Methods inherited from RunbyRange

#to_s

Constructor Details

#initialize(fast, slow) ⇒ SpeedRange

Returns a new instance of SpeedRange.



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

def initialize(fast, slow)
  raise 'Invalid speed values' unless fast.is_a?(Numeric) && slow.is_a?(Numeric)
  @fast = fast.round(2)
  @slow = slow.round(2)
end