Module: Strava::Api::Endpoints::Athletes
- Included in:
- Client
- Defined in:
- lib/strava/api/endpoints/athletes.rb
Overview
API endpoints for Strava athletes.
Athletes represent Strava users. This module provides methods for retrieving athlete profiles, stats, zones, and updating athlete information.
Instance Method Summary collapse
-
#athlete ⇒ Strava::Models::DetailedAthlete
Get the authenticated athlete's profile.
-
#athlete_stats(id_or_options, options = {}) ⇒ Strava::Models::ActivityStats
Get activity statistics for an athlete.
-
#athlete_zones(options = {}) ⇒ Strava::Models::Zones
Get the authenticated athlete's heart rate and power zones.
-
#update_athlete(options = {}) ⇒ Strava::Models::DetailedAthlete
Update the authenticated athlete's profile.
Instance Method Details
#athlete ⇒ Strava::Models::DetailedAthlete
Get the authenticated athlete's profile.
Returns the currently authenticated athlete with detailed information. Requires profile:read_all scope for full profile access.
30 31 32 |
# File 'lib/strava/api/endpoints/athletes.rb', line 30 def athlete Strava::Models::DetailedAthlete.new(get('athlete')) end |
#athlete_stats(id_or_options, options = {}) ⇒ Strava::Models::ActivityStats
Get activity statistics for an athlete.
Returns the activity stats of an athlete including recent totals, year-to-date totals, and all-time totals for different activity types.
73 74 75 76 |
# File 'lib/strava/api/endpoints/athletes.rb', line 73 def athlete_stats(, = {}) id, = parse_args(, ) Strava::Models::ActivityStats.new(get("athletes/#{id}/stats", )) end |
#athlete_zones(options = {}) ⇒ Strava::Models::Zones
Get the authenticated athlete's heart rate and power zones.
Returns the athlete's configured training zones for heart rate and power. These zones are used for training analysis and activity classification.
51 52 53 |
# File 'lib/strava/api/endpoints/athletes.rb', line 51 def athlete_zones( = {}) Strava::Models::Zones.new(get('athlete/zones', )) end |
#update_athlete(options = {}) ⇒ Strava::Models::DetailedAthlete
Update the authenticated athlete's profile.
Updates the currently authenticated athlete. Only weight can be updated. Requires profile:write scope.
94 95 96 |
# File 'lib/strava/api/endpoints/athletes.rb', line 94 def update_athlete( = {}) Strava::Models::DetailedAthlete.new(put('athlete', )) end |