Class: RunbyPace::RunTypes::TempoRun
- Inherits:
-
RunbyPace::RunType
- Object
- RunbyPace::RunType
- RunbyPace::RunTypes::TempoRun
- Defined in:
- lib/runby_pace/run_types/tempo_run.rb
Overview
Combines the fast and slow tempo runs into one convenient range of paces
Direct Known Subclasses
Defined Under Namespace
Classes: GoldenPaces
Instance Attribute Summary collapse
-
#fast_pace_data ⇒ Object
readonly
Returns the value of attribute fast_pace_data.
-
#slow_pace_data ⇒ Object
readonly
Returns the value of attribute slow_pace_data.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize ⇒ TempoRun
constructor
A new instance of TempoRun.
- #pace(five_k_time, distance_units = :km) ⇒ Object
Constructor Details
#initialize ⇒ TempoRun
11 12 13 14 |
# File 'lib/runby_pace/run_types/tempo_run.rb', line 11 def initialize @fast_pace_data = PaceData.new(GoldenPaces.fast[:'14:00'], GoldenPaces.fast[:'42:00'], 4.025) @slow_pace_data = PaceData.new(GoldenPaces.slow[:'14:00'], GoldenPaces.slow[:'42:00'], 3.725) end |
Instance Attribute Details
#fast_pace_data ⇒ Object (readonly)
Returns the value of attribute fast_pace_data.
5 6 7 |
# File 'lib/runby_pace/run_types/tempo_run.rb', line 5 def fast_pace_data @fast_pace_data end |
#slow_pace_data ⇒ Object (readonly)
Returns the value of attribute slow_pace_data.
5 6 7 |
# File 'lib/runby_pace/run_types/tempo_run.rb', line 5 def slow_pace_data @slow_pace_data end |
Instance Method Details
#description ⇒ Object
7 8 9 |
# File 'lib/runby_pace/run_types/tempo_run.rb', line 7 def description 'Tempo Run' end |
#pace(five_k_time, distance_units = :km) ⇒ Object
16 17 18 19 20 |
# File 'lib/runby_pace/run_types/tempo_run.rb', line 16 def pace(five_k_time, distance_units = :km) fast = @fast_pace_data.calc(five_k_time, distance_units) slow = @slow_pace_data.calc(five_k_time, distance_units) PaceRange.new(fast, slow) end |