Sha256: 4db446e9e02f48a549da1b695068f1801ddcab9b0e569a8db5d09d6deee452bd

Contents?: true

Size: 382 Bytes

Versions: 3

Compression:

Stored size: 382 Bytes

Contents

module RunbyPace

  class RunMath
    def self.convert_pace_to_speed(pace)
      pace = RunbyPace::PaceTime.new(pace)
      (60 / pace.total_minutes).round(2)
    end

    def self.convert_speed_to_pace(units_per_hour)
      raise 'units_per_hour must be numeric' unless units_per_hour.is_a? Numeric
      RunbyPace::PaceTime.from_minutes (60.0 / units_per_hour)
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
runby_pace-0.2.68 lib/runby_pace/run_math.rb
runby_pace-0.2.67 lib/runby_pace/run_math.rb
runby_pace-0.2.66 lib/runby_pace/run_math.rb