Module: Strava::Api::Endpoints::Athletes

Included in:
Client
Defined in:
lib/strava/api/endpoints/athletes.rb

Instance Method Summary collapse

Instance Method Details

#athleteObject

Returns the currently authenticated athlete.



8
9
10
# File 'lib/strava/api/endpoints/athletes.rb', line 8

def athlete
  Strava::Models::Athlete.new(get('athlete'))
end

#athlete_stats(id_or_options, options = {}) ⇒ Object

Returns the activity stats of an athlete.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :id (String)

    Athlete id.



25
26
27
28
# File 'lib/strava/api/endpoints/athletes.rb', line 25

def athlete_stats(id_or_options, options = {})
  id, options = parse_args(id_or_options, options)
  Strava::Models::ActivityStats.new(get("athletes/#{id}/stats", options))
end

#athlete_zones(options = {}) ⇒ Object

Returns the the authenticated athlete’s heart rate and power zones.



15
16
17
# File 'lib/strava/api/endpoints/athletes.rb', line 15

def athlete_zones(options = {})
  Strava::Models::Zones.new(get('athlete/zones', options))
end

#update_athlete(options = {}) ⇒ Object

Update the currently authenticated athlete.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :weight (Float)

    The weight of the athlete in kilograms.



36
37
38
# File 'lib/strava/api/endpoints/athletes.rb', line 36

def update_athlete(options = {})
  Strava::Models::Athlete.new(put('athlete', options))
end