Class: RunbyPace::RunMath
- Inherits:
-
Object
- Object
- RunbyPace::RunMath
- Defined in:
- lib/runby_pace/run_math.rb
Class Method Summary collapse
Class Method Details
.convert_pace_to_speed(pace) ⇒ Object
3 4 5 6 |
# File 'lib/runby_pace/run_math.rb', line 3 def self.convert_pace_to_speed(pace) pace = RunbyPace::PaceTime.new(pace) (60 / pace.total_minutes).round(2) end |
.convert_speed_to_pace(units_per_hour) ⇒ Object
8 9 10 11 |
# File 'lib/runby_pace/run_math.rb', line 8 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 |