Class: Strava::Api::Client
- Inherits:
-
Web::Client
- Object
- Web::Client
- Strava::Api::Client
- Includes:
- Endpoints::Activities, Endpoints::Athletes, Endpoints::Clubs, Endpoints::Gears, Endpoints::OAuth, Endpoints::Routes, Endpoints::SegmentEfforts, Endpoints::Segments, Endpoints::Streams, Endpoints::Uploads
- Defined in:
- lib/strava/api/client.rb
Overview
Main API client for interacting with the Strava API v3.
This class provides a complete Ruby interface to the Strava API, including support for:
- Activities (create, read, update, list)
- Athletes (profile, stats, zones)
- Clubs (details, members, activities)
- Gear (equipment details)
- Routes (details, GPX/TCX export)
- Segments and Segment Efforts
- Streams (activity, route, segment data)
- Uploads (activity file uploads)
- OAuth (token refresh, deauthorization)
Class Method Summary collapse
-
.config ⇒ Strava::Api::Config
Returns the configuration object.
-
.configure {|Config| ... } ⇒ Strava::Api::Config
Configure the API client globally.
Instance Method Summary collapse
-
#headers ⇒ Hash
private
Returns HTTP headers for API requests.
-
#initialize(options = {}) ⇒ Client
constructor
Initialize a new API client.
Methods included from Endpoints::OAuth
Methods included from Endpoints::Uploads
Methods included from Endpoints::Streams
#activity_streams, #segment_effort_streams, #segment_streams
Methods included from Endpoints::Segments
#explore_segments, #segment, #star_segment, #starred_segments
Methods included from Endpoints::SegmentEfforts
#segment_effort, #segment_efforts
Methods included from Endpoints::Routes
#athlete_routes, #export_route_gpx, #export_route_tcx, #route
Methods included from Endpoints::Gears
Methods included from Endpoints::Clubs
#athlete_clubs, #club, #club_events
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
Constructor Details
Class Method Details
.config ⇒ Strava::Api::Config
Returns the configuration object.
104 105 106 |
# File 'lib/strava/api/client.rb', line 104 def config Config end |
.configure {|Config| ... } ⇒ Strava::Api::Config
Configure the API client globally.
95 96 97 |
# File 'lib/strava/api/client.rb', line 95 def configure block_given? ? yield(Config) : Config end |
Instance Method Details
#headers ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns HTTP headers for API requests.
79 80 81 |
# File 'lib/strava/api/client.rb', line 79 def headers { 'Authorization' => "Bearer #{access_token}" } end |