Class: Runby::RunTypes::LongRun
- Inherits:
-
Runby::RunType
- Object
- Runby::RunType
- Runby::RunTypes::LongRun
- Defined in:
- lib/runby_pace/run_types/long_run.rb
Overview
Arguably one of the most important run types, the “long run” is harder than an “easy run”, but easier than
a "distance run". It should remain conversational.
Defined Under Namespace
Classes: GoldenPaces
Instance Attribute Summary collapse
-
#fast_pace_calculator ⇒ Object
readonly
Returns the value of attribute fast_pace_calculator.
-
#slow_pace_calculator ⇒ Object
readonly
Returns the value of attribute slow_pace_calculator.
Instance Method Summary collapse
- #description ⇒ Object
- #explanation ⇒ Object
-
#initialize ⇒ LongRun
constructor
A new instance of LongRun.
- #lookup_pace(five_k_time, distance_units = :km) ⇒ Object
Constructor Details
#initialize ⇒ LongRun
Returns a new instance of LongRun.
18 19 20 21 |
# File 'lib/runby_pace/run_types/long_run.rb', line 18 def initialize @fast_pace_calculator = PaceCalculator.new(GoldenPaces.fast, 2.125) @slow_pace_calculator = PaceCalculator.new(GoldenPaces.slow, 1.55) end |
Instance Attribute Details
#fast_pace_calculator ⇒ Object (readonly)
Returns the value of attribute fast_pace_calculator.
8 9 10 |
# File 'lib/runby_pace/run_types/long_run.rb', line 8 def fast_pace_calculator @fast_pace_calculator end |
#slow_pace_calculator ⇒ Object (readonly)
Returns the value of attribute slow_pace_calculator.
8 9 10 |
# File 'lib/runby_pace/run_types/long_run.rb', line 8 def slow_pace_calculator @slow_pace_calculator end |
Instance Method Details
#description ⇒ Object
10 11 12 |
# File 'lib/runby_pace/run_types/long_run.rb', line 10 def description 'Long Run' end |
#explanation ⇒ Object
14 15 16 |
# File 'lib/runby_pace/run_types/long_run.rb', line 14 def explanation 'For many runners, the long run is the favorite run of the week. It is usually only ran once per week, and accounts for 20-25% of your weekly training volume. Remember that it\'s not a race. It should remain comfortable.' end |
#lookup_pace(five_k_time, distance_units = :km) ⇒ Object
23 24 25 26 27 |
# File 'lib/runby_pace/run_types/long_run.rb', line 23 def lookup_pace(five_k_time, distance_units = :km) fast = @fast_pace_calculator.calc(five_k_time, distance_units) slow = @slow_pace_calculator.calc(five_k_time, distance_units) PaceRange.new(fast, slow) end |