Class: Strava::Api::Client

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Endpoints::OAuth

#deauthorize

Methods included from Endpoints::Uploads

#create_upload, #upload

Methods included from Endpoints::Streams

#activity_streams, #segment_effort_streams, #segment_streams

Methods included from Endpoints::Segments

#explore_segments, #segment, #segment_leaderboard, #star_segment, #starred_segments

Methods included from Endpoints::SegmentEfforts

#segment_effort, #segment_efforts

Methods included from Endpoints::RunningRaces

#running_race, #running_races

Methods included from Endpoints::Routes

#athlete_routes, #export_route_gpx, #export_route_tcx, #route

Methods included from Endpoints::Gears

#gear

Methods included from Endpoints::Clubs

#athlete_clubs, #club, #club_activities, #club_admins, #club_members

Methods included from Endpoints::Athletes

#athlete, #athlete_stats, #athlete_zones, #update_athlete

Methods included from Endpoints::Activities

#activity, #activity_comments, #activity_kudos, #activity_laps, #activity_photos, #activity_zones, #athlete_activities, #create_activity, #update_activity

Methods inherited from Web::Client

#endpoint, #parse_args

Methods included from Web::Request

#delete, #get, #post, #put

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



18
19
20
21
22
23
# File 'lib/strava/api/client.rb', line 18

def initialize(options = {})
  Config::ATTRIBUTES.each do |key|
    send("#{key}=", options[key] || Strava::Api.config.send(key))
  end
  super
end

Class Method Details

.configObject



34
35
36
# File 'lib/strava/api/client.rb', line 34

def config
  Config
end

.configureObject



30
31
32
# File 'lib/strava/api/client.rb', line 30

def configure
  block_given? ? yield(Config) : Config
end

Instance Method Details

#headersObject



25
26
27
# File 'lib/strava/api/client.rb', line 25

def headers
  { 'Authorization' => "Bearer #{access_token}" }
end