Class: Strava::Models::Route
- Inherits:
-
Response
- Object
- Hashie::Trash
- Strava::Model
- Response
- Strava::Models::Route
- Defined in:
- lib/strava/models/route.rb
Overview
Represents a Strava route.
Routes are planned courses that athletes can follow for activities. They include map data, waypoints, and estimated moving time. Routes can be exported as GPX or TCX files for use with GPS devices.
Includes helper mixins for formatting distance, elevation gain, and time.
Instance Method Summary collapse
-
#athlete ⇒ SummaryAthlete
The athlete who created this route.
-
#created_at ⇒ Time
When the route was created.
-
#description ⇒ String?
Route description.
-
#id ⇒ Integer
Route ID.
-
#id_str ⇒ String
Route ID as a string.
-
#map ⇒ Map
Route map with polyline data.
-
#map_urls ⇒ Hash?
URLs to map images at various sizes.
-
#name ⇒ String
Route name.
-
#private ⇒ Boolean
Whether this route is private.
-
#resource_state ⇒ Integer?
Resource state indicator.
-
#segments ⇒ Array<SummarySegment>
Segments along this route.
-
#starred ⇒ Boolean
Whether this route has been starred by the authenticated athlete.
-
#sub_type ⇒ Integer
Route sub-type for additional categorization.
-
#timestamp ⇒ Time
Timestamp for the route.
-
#type ⇒ Integer
Route type (1 = Ride, 2 = Run).
-
#updated_at ⇒ Time
When the route was last updated.
-
#waypoints ⇒ Array<Waypoint>
Waypoints along this route.
Methods included from Mixins::EstimatedMovingTime
#estimated_moving_time_in_hours_s
Methods included from Mixins::ElevationGain
#elevation_gain_in_feet, #elevation_gain_in_feet_s, #elevation_gain_in_meters, #elevation_gain_in_meters_s, #elevation_gain_s
Methods included from Mixins::Distance
#distance_in_feet, #distance_in_kilometers, #distance_in_kilometers_s, #distance_in_meters, #distance_in_meters_s, #distance_in_miles, #distance_in_miles_s, #distance_in_yards, #distance_in_yards_s, #distance_s
Instance Method Details
#athlete ⇒ SummaryAthlete
Returns The athlete who created this route.
33 |
# File 'lib/strava/models/route.rb', line 33 property 'athlete', transform_with: ->(v) { Strava::Models::SummaryAthlete.new(v) } |
#created_at ⇒ Time
Returns When the route was created.
69 |
# File 'lib/strava/models/route.rb', line 69 property 'created_at', transform_with: ->(v) { Time.parse(v) } |
#description ⇒ String?
Returns Route description.
36 |
# File 'lib/strava/models/route.rb', line 36 property 'description' |
#id ⇒ Integer
Returns Route ID.
42 |
# File 'lib/strava/models/route.rb', line 42 property 'id' |
#id_str ⇒ String
Returns Route ID as a string.
45 |
# File 'lib/strava/models/route.rb', line 45 property 'id_str' |
#map ⇒ Map
Returns Route map with polyline data.
48 |
# File 'lib/strava/models/route.rb', line 48 property 'map', transform_with: ->(v) { Strava::Models::Map.new(v) } |
#map_urls ⇒ Hash?
Undocumented in official API
Returns URLs to map images at various sizes.
84 |
# File 'lib/strava/models/route.rb', line 84 property 'map_urls' |
#name ⇒ String
Returns Route name.
51 |
# File 'lib/strava/models/route.rb', line 51 property 'name' |
#private ⇒ Boolean
Returns Whether this route is private.
54 |
# File 'lib/strava/models/route.rb', line 54 property 'private' |
#resource_state ⇒ Integer?
Undocumented in official API
Returns Resource state indicator.
88 |
# File 'lib/strava/models/route.rb', line 88 property 'resource_state' |
#segments ⇒ Array<SummarySegment>
Returns Segments along this route.
77 |
# File 'lib/strava/models/route.rb', line 77 property 'segments', transform_with: ->(v) { v.map { |r| Strava::Models::SummarySegment.new(r) } } |
#starred ⇒ Boolean
Returns Whether this route has been starred by the authenticated athlete.
57 |
# File 'lib/strava/models/route.rb', line 57 property 'starred' |
#sub_type ⇒ Integer
Returns Route sub-type for additional categorization.
66 |
# File 'lib/strava/models/route.rb', line 66 property 'sub_type' |
#timestamp ⇒ Time
Returns Timestamp for the route.
60 |
# File 'lib/strava/models/route.rb', line 60 property 'timestamp', transform_with: ->(v) { Time.at(v) } |
#type ⇒ Integer
Returns Route type (1 = Ride, 2 = Run).
63 |
# File 'lib/strava/models/route.rb', line 63 property 'type' |
#updated_at ⇒ Time
Returns When the route was last updated.
72 |
# File 'lib/strava/models/route.rb', line 72 property 'updated_at', transform_with: ->(v) { Time.parse(v) } |