Class: Strava::Models::ActivityTotal

Inherits:
Response show all
Includes:
Mixins::Distance, Mixins::ElapsedTime, Mixins::ElevationGain, Mixins::MovingTime
Defined in:
lib/strava/models/activity_total.rb

Overview

Represents totals for a specific activity type and time period.

Contains aggregated counts, distance, time, and elevation for activities. Used within ActivityStats to break down statistics by activity type (ride, run, swim) and period (recent, YTD, all-time).

Includes helper mixins for formatting distance, time, and elevation.

Examples:

Access activity totals

stats = client.athlete_stats(12345)
totals = stats.recent_run_totals
puts "#{totals.count} runs"
puts "Total distance: #{totals.distance_s}"
puts "Moving time: #{totals.moving_time_in_hours_s}"
puts "Elevation: #{totals.elevation_gain_s}"
puts "Achievements: #{totals.achievement_count}"

See Also:

Instance Method Summary collapse

Methods included from Mixins::ElevationGain

#elevation_gain_in_feet, #elevation_gain_in_feet_s, #elevation_gain_in_meters, #elevation_gain_in_meters_s, #elevation_gain_s

Methods included from Mixins::ElapsedTime

#elapsed_time_in_hours_s

Methods included from Mixins::MovingTime

#moving_time_in_hours_s

Methods included from Mixins::Distance

#distance_in_feet, #distance_in_kilometers, #distance_in_kilometers_s, #distance_in_meters, #distance_in_meters_s, #distance_in_miles, #distance_in_miles_s, #distance_in_yards, #distance_in_yards_s, #distance_s

Instance Method Details

#achievement_countInteger

Returns Total number of achievements/trophies earned.

Returns:

  • (Integer)

    Total number of achievements/trophies earned



36
# File 'lib/strava/models/activity_total.rb', line 36

property 'achievement_count'

#countInteger

Returns Number of activities.

Returns:

  • (Integer)

    Number of activities



28
# File 'lib/strava/models/activity_total.rb', line 28

property 'count'