Module: Strava::Api::Endpoints::Routes

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

Instance Method Summary collapse

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.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :id (Integer)

    The identifier of the athlete.

  • :page (Integer)

    Page number.

  • :per_page (Integer)

    Number of items per page. Defaults to 30.



50
51
52
53
# File 'lib/strava/api/endpoints/routes.rb', line 50

def athlete_routes(id_or_options, options = {}, &block)
  id, options = parse_args(id_or_options, options)
  paginate "athletes/#{id}/routes", options, Strava::Models::Route, &block
end

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

Returns a GPX file of the route.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :id (String)

    Route id.



13
14
15
16
# File 'lib/strava/api/endpoints/routes.rb', line 13

def export_route_gpx(id_or_options, options = {})
  id, options = parse_args(id_or_options, options)
  get("routes/#{id}/export_gpx", options).response
end

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

Returns a TCS file of the route.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :id (String)

    Route id.



24
25
26
27
# File 'lib/strava/api/endpoints/routes.rb', line 24

def export_route_tcx(id_or_options, options = {})
  id, options = parse_args(id_or_options, options)
  get("routes/#{id}/export_tcx", options).response
end

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

Returns a route using its identifier.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :id (String)

    Route id.



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

def route(id_or_options, options = {})
  id, options = parse_args(id_or_options, options)
  Strava::Models::Route.new(get("routes/#{id}", options))
end