Sha256: 91ca3649723be25378dc519364949f2285e8a0138a1b94b5cee4bb6d3f236c3f

Contents?: true

Size: 953 Bytes

Versions: 1

Compression:

Stored size: 953 Bytes

Contents

module RunbyPace

  module RunTypes

    class LongRun < RunType
      attr_reader :slow_pace_data, :fast_pace_data

      def initialize
        @fast_pace_data = PaceData.new(GoldenPaces::fast[:'14:00'], GoldenPaces::fast[:'42:00'], 2.125)
        @slow_pace_data = PaceData.new(GoldenPaces::slow[:'14:00'], GoldenPaces::slow[:'42:00'], 1.55)
      end

      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

      class GoldenPaces
        def self.fast
          { '14:00': '04:00', '15:00': '04:16', '20:00': '05:31', '25:00': '06:44', '30:00': '07:54', '35:00':'09:01', '40:00':'10:07', '42:00':'10:32'}
        end
        def self.slow
          { '14:00': '04:39', '15:00': '04:57', '20:00': '06:22', '25:00': '07:43', '30:00': '09:00', '35:00':'10:15', '40:00':'11:26', '42:00':'11:53'}
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
runby_pace-0.2.39 lib/runby_pace/run_types/long_run.rb