Class: RunbyPace::RunTypes::LongRun

Inherits:
RunbyPace::RunType show all
Defined in:
lib/runby_pace/run_types/long_run.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ LongRun

Returns a new instance of LongRun.



8
9
10
11
# File 'lib/runby_pace/run_types/long_run.rb', line 8

def initialize
  @slow_pace_data = PaceData.new('04:39', '11:53', 1.55)
  @fast_pace_data = PaceData.new('04:00', '10:32', 1.99)
end

Instance Attribute Details

#fast_pace_data ⇒ Object (readonly)

Returns the value of attribute fast_pace_data.



6
7
8
# File 'lib/runby_pace/run_types/long_run.rb', line 6

def fast_pace_data
  @fast_pace_data
end

#slow_pace_data ⇒ Object (readonly)

Returns the value of attribute slow_pace_data.



6
7
8
# File 'lib/runby_pace/run_types/long_run.rb', line 6

def slow_pace_data
  @slow_pace_data
end

Instance Method Details

#pace(five_k_time) ⇒ Object



13
14
15
16
17
# File 'lib/runby_pace/run_types/long_run.rb', line 13

def pace(five_k_time)
  fast = @fast_pace_data.calc(five_k_time)
  slow = @slow_pace_data.calc(five_k_time)
  PaceRange.new(fast, slow)
end