Module: Strava::Api::Endpoints::Routes
- Included in:
- Client
- Defined in:
- lib/strava/api/endpoints/routes.rb
Overview
API endpoints for Strava routes.
Routes are manually-created paths on Strava that can be used for planning. Routes can be exported in GPX or TCX format and can include waypoints, elevation data, and other metadata.
Instance Method Summary collapse
-
#athlete_routes(id_or_options, options = {}, &block) ⇒ Object
Returns a list of the routes created by the authenticated athlete using their athlete ID.
-
#export_route_gpx(id_or_options, options = {}) ⇒ Object
Returns a GPX file of the route.
-
#export_route_tcx(id_or_options, options = {}) ⇒ Object
Returns a TCX file of the route.
-
#route(id_or_options, options = {}) ⇒ Object
Returns a route using its identifier.
Instance Method Details
#athlete_routes(id_or_options, options = {}, &block) ⇒ Object
Returns a list of the routes created by the authenticated athlete using their athlete ID.
57 58 59 60 |
# File 'lib/strava/api/endpoints/routes.rb', line 57 def athlete_routes(, = {}, &block) id, = parse_args(, ) paginate "athletes/#{id}/routes", , Strava::Models::Route, &block end |
#export_route_gpx(id_or_options, options = {}) ⇒ Object
Returns a GPX file of the route.
22 23 24 25 |
# File 'lib/strava/api/endpoints/routes.rb', line 22 def export_route_gpx(, = {}) id, = parse_args(, ) get("routes/#{id}/export_gpx", ).response end |
#export_route_tcx(id_or_options, options = {}) ⇒ Object
Returns a TCX file of the route.
33 34 35 36 |
# File 'lib/strava/api/endpoints/routes.rb', line 33 def export_route_tcx(, = {}) id, = parse_args(, ) get("routes/#{id}/export_tcx", ).response end |