Class: Strava::Models::SummaryActivity
- Inherits:
-
Response
- Object
- Hashie::Trash
- Strava::Model
- Response
- Strava::Models::SummaryActivity
- Includes:
- Mixins::Distance, Mixins::ElapsedTime, Mixins::MovingTime, Mixins::SportType, Mixins::StartDateLocal, Mixins::TotalElevationGain
- Defined in:
- lib/strava/models/summary_activity.rb
Overview
Represents a summary view of a Strava activity.
A summary activity contains the most important information about an activity without the detailed segments, splits, and other extended data found in DetailedActivity. This model is typically returned when listing activities or when full details are not needed.
Includes helper mixins for formatting distance, time, elevation, speed, and sport type.
Instance Method Summary collapse
-
#achievement_count ⇒ Integer
Number of achievements (segment PRs, CRs, etc.).
-
#athlete ⇒ MetaAthlete
The athlete who performed the activity.
-
#athlete_count ⇒ Integer
Number of athletes who participated (group activities).
-
#average_cadence ⇒ Float?
Average cadence (RPM for cycling, steps/minute for running).
-
#average_heartrate ⇒ Float?
Average heart rate in beats per minute.
-
#average_speed ⇒ Float
Average speed in meters per second.
-
#average_temp ⇒ Float?
Average temperature during the activity in Celsius.
-
#average_watts ⇒ Float?
Average power in watts.
-
#comment_count ⇒ Integer
Number of comments.
-
#commute ⇒ Boolean
Whether this activity was a commute.
-
#device_watts ⇒ Boolean?
Whether the watts are from a power meter (true) or estimated (false).
-
#display_hide_heartrate_option ⇒ Boolean?
Whether to display the hide heart rate option.
-
#elev_high ⇒ Float?
Highest elevation in meters.
-
#elev_low ⇒ Float?
Lowest elevation in meters.
-
#end_latlng ⇒ LatLng?
Ending coordinates [latitude, longitude].
-
#external_id ⇒ String?
External ID from the original upload source.
-
#flagged ⇒ Boolean
Whether this activity has been flagged.
-
#from_accepted_tag ⇒ Boolean?
Whether the activity was created from an accepted tag.
-
#gear_id ⇒ String?
Gear (bike/shoes) ID used for this activity.
-
#has_heartrate ⇒ Boolean?
Whether the activity has heart rate data.
-
#has_kudoed ⇒ Boolean
Whether the authenticated athlete has kudoed this activity.
-
#heartrate_opt_out ⇒ Boolean?
Whether the athlete has opted out of heart rate display.
-
#hide_from_home ⇒ Boolean
Whether to hide this activity from the home feed.
-
#id ⇒ Integer
Activity ID.
-
#kilojoules ⇒ Float?
Kilojoules of energy expended.
-
#kudos_count ⇒ Integer
Number of kudos received.
-
#location_city ⇒ String?
City where the activity took place.
-
#location_country ⇒ String?
Country where the activity took place.
-
#location_state ⇒ String?
State/province where the activity took place.
-
#manual ⇒ Boolean
Whether this activity was manually entered.
-
#map ⇒ Map
Activity map with polyline data.
-
#max_heartrate ⇒ Float?
Maximum heart rate in beats per minute.
-
#max_speed ⇒ Float
Maximum speed in meters per second.
-
#max_watts ⇒ Integer?
Maximum power in watts.
-
#name ⇒ String
Activity name.
-
#photo_count ⇒ Integer
Number of photos attached.
-
#pr_count ⇒ Integer?
Number of personal records achieved in this activity.
-
#private ⇒ Boolean
Whether this activity is set to private.
-
#resource_state ⇒ Integer?
Resource state indicator.
-
#start_date ⇒ Time
Start date and time (UTC).
-
#start_latlng ⇒ LatLng?
Starting coordinates [latitude, longitude].
-
#strava_url ⇒ String
Returns the Strava web URL for this activity.
-
#suffer_score ⇒ Integer?
Relative effort score (suffer score).
-
#timezone ⇒ String
Timezone in which the activity was recorded.
-
#total_photo_count ⇒ Integer
Total number of photos including Instagram.
-
#trainer ⇒ Boolean
Whether this activity was on a stationary trainer.
-
#upload_id ⇒ Integer?
Upload ID.
-
#upload_id_str ⇒ String?
Upload ID as a string.
-
#utc_offset ⇒ Float?
UTC offset in seconds.
-
#visibility ⇒ String?
Activity visibility setting (e.g., 'everyone', 'followers_only').
-
#weighted_average_watts ⇒ Integer?
Weighted average power in watts.
-
#workout_type ⇒ Integer?
Workout type (e.g., 10 = Race, 11 = Workout).
Methods included from Mixins::SportType
#distance_s, #pace_s, #sport_type_emoji
Methods included from Mixins::TotalElevationGain
#total_elevation_gain_in_feet, #total_elevation_gain_in_feet_s, #total_elevation_gain_in_meters, #total_elevation_gain_in_meters_s, #total_elevation_gain_s
Methods included from Mixins::ElapsedTime
Methods included from Mixins::MovingTime
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
#achievement_count ⇒ Integer
Returns Number of achievements (segment PRs, CRs, etc.).
69 |
# File 'lib/strava/models/summary_activity.rb', line 69 property 'achievement_count' |
#athlete ⇒ MetaAthlete
Returns The athlete who performed the activity.
36 |
# File 'lib/strava/models/summary_activity.rb', line 36 property 'athlete', transform_with: ->(v) { Strava::Models::MetaAthlete.new(v) } |
#athlete_count ⇒ Integer
Returns Number of athletes who participated (group activities).
78 |
# File 'lib/strava/models/summary_activity.rb', line 78 property 'athlete_count' |
#average_cadence ⇒ Float?
Undocumented in official API
Returns Average cadence (RPM for cycling, steps/minute for running).
166 |
# File 'lib/strava/models/summary_activity.rb', line 166 property 'average_cadence' |
#average_heartrate ⇒ Float?
Undocumented in official API
Returns Average heart rate in beats per minute.
178 |
# File 'lib/strava/models/summary_activity.rb', line 178 property 'average_heartrate' |
#average_speed ⇒ Float
Returns Average speed in meters per second.
111 |
# File 'lib/strava/models/summary_activity.rb', line 111 property 'average_speed' |
#average_temp ⇒ Float?
Undocumented in official API
Returns Average temperature during the activity in Celsius.
170 |
# File 'lib/strava/models/summary_activity.rb', line 170 property 'average_temp' |
#average_watts ⇒ Float?
Returns Average power in watts.
129 |
# File 'lib/strava/models/summary_activity.rb', line 129 property 'average_watts' |
#comment_count ⇒ Integer
Returns Number of comments.
75 |
# File 'lib/strava/models/summary_activity.rb', line 75 property 'comment_count' |
#commute ⇒ Boolean
Returns Whether this activity was a commute.
93 |
# File 'lib/strava/models/summary_activity.rb', line 93 property 'commute' |
#device_watts ⇒ Boolean?
Returns Whether the watts are from a power meter (true) or estimated (false).
132 |
# File 'lib/strava/models/summary_activity.rb', line 132 property 'device_watts' |
#display_hide_heartrate_option ⇒ Boolean?
Undocumented in official API
Returns Whether to display the hide heart rate option.
190 |
# File 'lib/strava/models/summary_activity.rb', line 190 property 'display_hide_heartrate_option' |
#elev_high ⇒ Float?
Returns Highest elevation in meters.
47 |
# File 'lib/strava/models/summary_activity.rb', line 47 property 'elev_high' |
#elev_low ⇒ Float?
Returns Lowest elevation in meters.
50 |
# File 'lib/strava/models/summary_activity.rb', line 50 property 'elev_low' |
#end_latlng ⇒ LatLng?
Returns Ending coordinates [latitude, longitude].
66 |
# File 'lib/strava/models/summary_activity.rb', line 66 property 'end_latlng', transform_with: ->(v) { Strava::Models::LatLng.new(v) } |
#external_id ⇒ String?
Returns External ID from the original upload source.
30 |
# File 'lib/strava/models/summary_activity.rb', line 30 property 'external_id' |
#flagged ⇒ Boolean
Returns Whether this activity has been flagged.
102 |
# File 'lib/strava/models/summary_activity.rb', line 102 property 'flagged' |
#from_accepted_tag ⇒ Boolean?
Undocumented in official API
Returns Whether the activity was created from an accepted tag.
194 |
# File 'lib/strava/models/summary_activity.rb', line 194 property 'from_accepted_tag' |
#gear_id ⇒ String?
Returns Gear (bike/shoes) ID used for this activity.
123 |
# File 'lib/strava/models/summary_activity.rb', line 123 property 'gear_id' |
#has_heartrate ⇒ Boolean?
Undocumented in official API
Returns Whether the activity has heart rate data.
174 |
# File 'lib/strava/models/summary_activity.rb', line 174 property 'has_heartrate' |
#has_kudoed ⇒ Boolean
Returns Whether the authenticated athlete has kudoed this activity.
117 |
# File 'lib/strava/models/summary_activity.rb', line 117 property 'has_kudoed' |
#heartrate_opt_out ⇒ Boolean?
Undocumented in official API
Returns Whether the athlete has opted out of heart rate display.
186 |
# File 'lib/strava/models/summary_activity.rb', line 186 property 'heartrate_opt_out' |
#hide_from_home ⇒ Boolean
Returns Whether to hide this activity from the home feed.
120 |
# File 'lib/strava/models/summary_activity.rb', line 120 property 'hide_from_home' |
#id ⇒ Integer
Returns Activity ID.
27 |
# File 'lib/strava/models/summary_activity.rb', line 27 property 'id' |
#kilojoules ⇒ Float?
Returns Kilojoules of energy expended.
126 |
# File 'lib/strava/models/summary_activity.rb', line 126 property 'kilojoules' |
#kudos_count ⇒ Integer
Returns Number of kudos received.
72 |
# File 'lib/strava/models/summary_activity.rb', line 72 property 'kudos_count' |
#location_city ⇒ String?
Undocumented in official API
Returns City where the activity took place.
154 |
# File 'lib/strava/models/summary_activity.rb', line 154 property 'location_city' |
#location_country ⇒ String?
Undocumented in official API
Returns Country where the activity took place.
162 |
# File 'lib/strava/models/summary_activity.rb', line 162 property 'location_country' |
#location_state ⇒ String?
Undocumented in official API
Returns State/province where the activity took place.
158 |
# File 'lib/strava/models/summary_activity.rb', line 158 property 'location_state' |
#manual ⇒ Boolean
Returns Whether this activity was manually entered.
96 |
# File 'lib/strava/models/summary_activity.rb', line 96 property 'manual' |
#map ⇒ Map
Returns Activity map with polyline data.
87 |
# File 'lib/strava/models/summary_activity.rb', line 87 property 'map', transform_with: ->(v) { Strava::Models::Map.new(v) } |
#max_heartrate ⇒ Float?
Undocumented in official API
Returns Maximum heart rate in beats per minute.
182 |
# File 'lib/strava/models/summary_activity.rb', line 182 property 'max_heartrate' |
#max_speed ⇒ Float
Returns Maximum speed in meters per second.
114 |
# File 'lib/strava/models/summary_activity.rb', line 114 property 'max_speed' |
#max_watts ⇒ Integer?
Returns Maximum power in watts.
135 |
# File 'lib/strava/models/summary_activity.rb', line 135 property 'max_watts' |
#name ⇒ String
Returns Activity name.
39 |
# File 'lib/strava/models/summary_activity.rb', line 39 property 'name' |
#photo_count ⇒ Integer
Returns Number of photos attached.
81 |
# File 'lib/strava/models/summary_activity.rb', line 81 property 'photo_count' |
#pr_count ⇒ Integer?
Undocumented in official API
Returns Number of personal records achieved in this activity.
198 |
# File 'lib/strava/models/summary_activity.rb', line 198 property 'pr_count' |
#private ⇒ Boolean
Returns Whether this activity is set to private.
99 |
# File 'lib/strava/models/summary_activity.rb', line 99 property 'private' |
#resource_state ⇒ Integer?
Undocumented in official API
Returns Resource state indicator.
142 |
# File 'lib/strava/models/summary_activity.rb', line 142 property 'resource_state' |
#start_date ⇒ Time
Returns Start date and time (UTC).
55 |
# File 'lib/strava/models/summary_activity.rb', line 55 property 'start_date', transform_with: ->(v) { Time.parse(v) } |
#start_latlng ⇒ LatLng?
Returns Starting coordinates [latitude, longitude].
63 |
# File 'lib/strava/models/summary_activity.rb', line 63 property 'start_latlng', transform_with: ->(v) { Strava::Models::LatLng.new(v) } |
#strava_url ⇒ String
Returns the Strava web URL for this activity.
209 210 211 |
# File 'lib/strava/models/summary_activity.rb', line 209 def strava_url "https://www.strava.com/activities/#{id}" end |
#suffer_score ⇒ Integer?
Undocumented in official API
Returns Relative effort score (suffer score).
202 |
# File 'lib/strava/models/summary_activity.rb', line 202 property 'suffer_score' |
#timezone ⇒ String
Returns Timezone in which the activity was recorded.
60 |
# File 'lib/strava/models/summary_activity.rb', line 60 property 'timezone' |
#total_photo_count ⇒ Integer
Returns Total number of photos including Instagram.
84 |
# File 'lib/strava/models/summary_activity.rb', line 84 property 'total_photo_count' |
#trainer ⇒ Boolean
Returns Whether this activity was on a stationary trainer.
90 |
# File 'lib/strava/models/summary_activity.rb', line 90 property 'trainer' |
#upload_id ⇒ Integer?
Returns Upload ID.
33 |
# File 'lib/strava/models/summary_activity.rb', line 33 property 'upload_id' |
#upload_id_str ⇒ String?
Returns Upload ID as a string.
108 |
# File 'lib/strava/models/summary_activity.rb', line 108 property 'upload_id_str' |
#utc_offset ⇒ Float?
Undocumented in official API
Returns UTC offset in seconds.
150 |
# File 'lib/strava/models/summary_activity.rb', line 150 property 'utc_offset' |
#visibility ⇒ String?
Undocumented in official API
Returns Activity visibility setting (e.g., 'everyone', 'followers_only').
146 |
# File 'lib/strava/models/summary_activity.rb', line 146 property 'visibility' |
#weighted_average_watts ⇒ Integer?
Returns Weighted average power in watts.
138 |
# File 'lib/strava/models/summary_activity.rb', line 138 property 'weighted_average_watts' |
#workout_type ⇒ Integer?
Returns Workout type (e.g., 10 = Race, 11 = Workout).
105 |
# File 'lib/strava/models/summary_activity.rb', line 105 property 'workout_type' |