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.



48
49
50
51
# File 'lib/strava/api/endpoints/routes.rb', line 48

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.



11
12
13
14
# File 'lib/strava/api/endpoints/routes.rb', line 11

def export_route_gpx(id_or_options, options = {})
  id, options = parse_args(id_or_options, options)
  get "routes/#{id}/export_gpx", options
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.



22
23
24
25
# File 'lib/strava/api/endpoints/routes.rb', line 22

def export_route_tcx(id_or_options, options = {})
  id, options = parse_args(id_or_options, options)
  get "routes/#{id}/export_tcx", options
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.



33
34
35
36
# File 'lib/strava/api/endpoints/routes.rb', line 33

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