Module: Strava::Models::Mixins::EstimatedMovingTime

Extended by:
ActiveSupport::Concern
Includes:
TimeInHours
Included in:
Route
Defined in:
lib/strava/models/mixins/estimated_moving_time.rb

Overview

Provides estimated moving time formatting methods.

Estimated moving time is Strava's prediction of how long it will take to complete a route based on distance, elevation, and typical speeds. This is commonly used for routes.

Examples:

Using estimated moving time helpers

route = client.route(1234567)
puts route.estimated_moving_time              # => 5400 (seconds)
puts route.estimated_moving_time_in_hours_s   # => "1h30m"

Instance Method Summary collapse

Instance Method Details

#estimated_moving_time_in_hours_sString?

Returns formatted estimated moving time as hours, minutes, and seconds.

Returns:

  • (String, nil)

    Formatted time string (e.g., "1h23m45s", "45m30s", "30s")



32
33
34
# File 'lib/strava/models/mixins/estimated_moving_time.rb', line 32

def estimated_moving_time_in_hours_s
  time_in_hours_s estimated_moving_time
end