Sha256: 54ab591130e9417a51a9b003fc4559d91d8000bf131d531b3382048dbab9daeb

Contents?: true

Size: 1.13 KB

Versions: 7

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

module Strava
  module Api
    module Endpoints
      module Athletes
        #
        # Returns the currently authenticated athlete.
        #
        def athlete
          Strava::Models::Athlete.new(get('athlete'))
        end

        #
        # Returns the the authenticated athlete's heart rate and power zones.
        #
        def athlete_zones(options = {})
          Strava::Models::Zones.new(get('athlete/zones', options))
        end

        #
        # Returns the activity stats of an athlete.
        #
        # @option options [String] :id
        #   Athlete id.
        #
        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

        #
        # Update the currently authenticated athlete.
        #
        # @option options [Float] :weight
        #   The weight of the athlete in kilograms.
        #
        def update_athlete(options = {})
          Strava::Models::Athlete.new(put('athlete', options))
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
strava-ruby-client-2.2.0 lib/strava/api/endpoints/athletes.rb
strava-ruby-client-2.1.0 lib/strava/api/endpoints/athletes.rb
strava-ruby-client-2.0.0 lib/strava/api/endpoints/athletes.rb
strava-ruby-client-1.1.0 lib/strava/api/endpoints/athletes.rb
strava-ruby-client-1.0.1 lib/strava/api/endpoints/athletes.rb
strava-ruby-client-1.0.0 lib/strava/api/endpoints/athletes.rb
strava-ruby-client-0.4.3 lib/strava/api/endpoints/athletes.rb