Class: Strava::Models::SummaryActivity

Inherits:
Response show all
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.

Examples:

List and display activities

activities = client.athlete_activities(per_page: 10)
activities.each do |activity|
  puts "#{activity.name} - #{activity.distance_s} in #{activity.moving_time_in_hours_s}"
  puts activity.strava_url
end

See Also:

Instance Method Summary collapse

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

#elapsed_time_in_hours_s

Methods included from Mixins::MovingTime

#moving_time_in_hours_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

#achievement_countInteger

Returns Number of achievements (segment PRs, CRs, etc.).

Returns:

  • (Integer)

    Number of achievements (segment PRs, CRs, etc.)



69
# File 'lib/strava/models/summary_activity.rb', line 69

property 'achievement_count'

#athleteMetaAthlete

Returns The athlete who performed the activity.

Returns:

  • (MetaAthlete)

    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_countInteger

Returns Number of athletes who participated (group activities).

Returns:

  • (Integer)

    Number of athletes who participated (group activities)



78
# File 'lib/strava/models/summary_activity.rb', line 78

property 'athlete_count'

#average_cadenceFloat?

Note:

Undocumented in official API

Returns Average cadence (RPM for cycling, steps/minute for running).

Returns:

  • (Float, nil)

    Average cadence (RPM for cycling, steps/minute for running)



166
# File 'lib/strava/models/summary_activity.rb', line 166

property 'average_cadence'

#average_heartrateFloat?

Note:

Undocumented in official API

Returns Average heart rate in beats per minute.

Returns:

  • (Float, nil)

    Average heart rate in beats per minute



178
# File 'lib/strava/models/summary_activity.rb', line 178

property 'average_heartrate'

#average_speedFloat

Returns Average speed in meters per second.

Returns:

  • (Float)

    Average speed in meters per second



111
# File 'lib/strava/models/summary_activity.rb', line 111

property 'average_speed'

#average_tempFloat?

Note:

Undocumented in official API

Returns Average temperature during the activity in Celsius.

Returns:

  • (Float, nil)

    Average temperature during the activity in Celsius



170
# File 'lib/strava/models/summary_activity.rb', line 170

property 'average_temp'

#average_wattsFloat?

Returns Average power in watts.

Returns:

  • (Float, nil)

    Average power in watts



129
# File 'lib/strava/models/summary_activity.rb', line 129

property 'average_watts'

#comment_countInteger

Returns Number of comments.

Returns:

  • (Integer)

    Number of comments



75
# File 'lib/strava/models/summary_activity.rb', line 75

property 'comment_count'

#commuteBoolean

Returns Whether this activity was a commute.

Returns:

  • (Boolean)

    Whether this activity was a commute



93
# File 'lib/strava/models/summary_activity.rb', line 93

property 'commute'

#device_wattsBoolean?

Returns Whether the watts are from a power meter (true) or estimated (false).

Returns:

  • (Boolean, nil)

    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_optionBoolean?

Note:

Undocumented in official API

Returns Whether to display the hide heart rate option.

Returns:

  • (Boolean, nil)

    Whether to display the hide heart rate option



190
# File 'lib/strava/models/summary_activity.rb', line 190

property 'display_hide_heartrate_option'

#elev_highFloat?

Returns Highest elevation in meters.

Returns:

  • (Float, nil)

    Highest elevation in meters



47
# File 'lib/strava/models/summary_activity.rb', line 47

property 'elev_high'

#elev_lowFloat?

Returns Lowest elevation in meters.

Returns:

  • (Float, nil)

    Lowest elevation in meters



50
# File 'lib/strava/models/summary_activity.rb', line 50

property 'elev_low'

#end_latlngLatLng?

Returns Ending coordinates [latitude, longitude].

Returns:

  • (LatLng, nil)

    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_idString?

Returns External ID from the original upload source.

Returns:

  • (String, nil)

    External ID from the original upload source



30
# File 'lib/strava/models/summary_activity.rb', line 30

property 'external_id'

#flaggedBoolean

Returns Whether this activity has been flagged.

Returns:

  • (Boolean)

    Whether this activity has been flagged



102
# File 'lib/strava/models/summary_activity.rb', line 102

property 'flagged'

#from_accepted_tagBoolean?

Note:

Undocumented in official API

Returns Whether the activity was created from an accepted tag.

Returns:

  • (Boolean, nil)

    Whether the activity was created from an accepted tag



194
# File 'lib/strava/models/summary_activity.rb', line 194

property 'from_accepted_tag'

#gear_idString?

Returns Gear (bike/shoes) ID used for this activity.

Returns:

  • (String, nil)

    Gear (bike/shoes) ID used for this activity



123
# File 'lib/strava/models/summary_activity.rb', line 123

property 'gear_id'

#has_heartrateBoolean?

Note:

Undocumented in official API

Returns Whether the activity has heart rate data.

Returns:

  • (Boolean, nil)

    Whether the activity has heart rate data



174
# File 'lib/strava/models/summary_activity.rb', line 174

property 'has_heartrate'

#has_kudoedBoolean

Returns Whether the authenticated athlete has kudoed this activity.

Returns:

  • (Boolean)

    Whether the authenticated athlete has kudoed this activity



117
# File 'lib/strava/models/summary_activity.rb', line 117

property 'has_kudoed'

#heartrate_opt_outBoolean?

Note:

Undocumented in official API

Returns Whether the athlete has opted out of heart rate display.

Returns:

  • (Boolean, nil)

    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_homeBoolean

Returns Whether to hide this activity from the home feed.

Returns:

  • (Boolean)

    Whether to hide this activity from the home feed



120
# File 'lib/strava/models/summary_activity.rb', line 120

property 'hide_from_home'

#idInteger

Returns Activity ID.

Returns:

  • (Integer)

    Activity ID



27
# File 'lib/strava/models/summary_activity.rb', line 27

property 'id'

#kilojoulesFloat?

Returns Kilojoules of energy expended.

Returns:

  • (Float, nil)

    Kilojoules of energy expended



126
# File 'lib/strava/models/summary_activity.rb', line 126

property 'kilojoules'

#kudos_countInteger

Returns Number of kudos received.

Returns:

  • (Integer)

    Number of kudos received



72
# File 'lib/strava/models/summary_activity.rb', line 72

property 'kudos_count'

#location_cityString?

Note:

Undocumented in official API

Returns City where the activity took place.

Returns:

  • (String, nil)

    City where the activity took place



154
# File 'lib/strava/models/summary_activity.rb', line 154

property 'location_city'

#location_countryString?

Note:

Undocumented in official API

Returns Country where the activity took place.

Returns:

  • (String, nil)

    Country where the activity took place



162
# File 'lib/strava/models/summary_activity.rb', line 162

property 'location_country'

#location_stateString?

Note:

Undocumented in official API

Returns State/province where the activity took place.

Returns:

  • (String, nil)

    State/province where the activity took place



158
# File 'lib/strava/models/summary_activity.rb', line 158

property 'location_state'

#manualBoolean

Returns Whether this activity was manually entered.

Returns:

  • (Boolean)

    Whether this activity was manually entered



96
# File 'lib/strava/models/summary_activity.rb', line 96

property 'manual'

#mapMap

Returns Activity map with polyline data.

Returns:

  • (Map)

    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_heartrateFloat?

Note:

Undocumented in official API

Returns Maximum heart rate in beats per minute.

Returns:

  • (Float, nil)

    Maximum heart rate in beats per minute



182
# File 'lib/strava/models/summary_activity.rb', line 182

property 'max_heartrate'

#max_speedFloat

Returns Maximum speed in meters per second.

Returns:

  • (Float)

    Maximum speed in meters per second



114
# File 'lib/strava/models/summary_activity.rb', line 114

property 'max_speed'

#max_wattsInteger?

Returns Maximum power in watts.

Returns:

  • (Integer, nil)

    Maximum power in watts



135
# File 'lib/strava/models/summary_activity.rb', line 135

property 'max_watts'

#nameString

Returns Activity name.

Returns:

  • (String)

    Activity name



39
# File 'lib/strava/models/summary_activity.rb', line 39

property 'name'

#photo_countInteger

Returns Number of photos attached.

Returns:

  • (Integer)

    Number of photos attached



81
# File 'lib/strava/models/summary_activity.rb', line 81

property 'photo_count'

#pr_countInteger?

Note:

Undocumented in official API

Returns Number of personal records achieved in this activity.

Returns:

  • (Integer, nil)

    Number of personal records achieved in this activity



198
# File 'lib/strava/models/summary_activity.rb', line 198

property 'pr_count'

#privateBoolean

Returns Whether this activity is set to private.

Returns:

  • (Boolean)

    Whether this activity is set to private



99
# File 'lib/strava/models/summary_activity.rb', line 99

property 'private'

#resource_stateInteger?

Note:

Undocumented in official API

Returns Resource state indicator.

Returns:

  • (Integer, nil)

    Resource state indicator



142
# File 'lib/strava/models/summary_activity.rb', line 142

property 'resource_state'

#start_dateTime

Returns Start date and time (UTC).

Returns:

  • (Time)

    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_latlngLatLng?

Returns Starting coordinates [latitude, longitude].

Returns:

  • (LatLng, nil)

    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_urlString

Returns the Strava web URL for this activity.

Returns:

  • (String)

    Full URL to view the activity on Strava.com



209
210
211
# File 'lib/strava/models/summary_activity.rb', line 209

def strava_url
  "https://www.strava.com/activities/#{id}"
end

#suffer_scoreInteger?

Note:

Undocumented in official API

Returns Relative effort score (suffer score).

Returns:

  • (Integer, nil)

    Relative effort score (suffer score)



202
# File 'lib/strava/models/summary_activity.rb', line 202

property 'suffer_score'

#timezoneString

Returns Timezone in which the activity was recorded.

Returns:

  • (String)

    Timezone in which the activity was recorded



60
# File 'lib/strava/models/summary_activity.rb', line 60

property 'timezone'

#total_photo_countInteger

Returns Total number of photos including Instagram.

Returns:

  • (Integer)

    Total number of photos including Instagram



84
# File 'lib/strava/models/summary_activity.rb', line 84

property 'total_photo_count'

#trainerBoolean

Returns Whether this activity was on a stationary trainer.

Returns:

  • (Boolean)

    Whether this activity was on a stationary trainer



90
# File 'lib/strava/models/summary_activity.rb', line 90

property 'trainer'

#upload_idInteger?

Returns Upload ID.

Returns:

  • (Integer, nil)

    Upload ID



33
# File 'lib/strava/models/summary_activity.rb', line 33

property 'upload_id'

#upload_id_strString?

Returns Upload ID as a string.

Returns:

  • (String, nil)

    Upload ID as a string



108
# File 'lib/strava/models/summary_activity.rb', line 108

property 'upload_id_str'

#utc_offsetFloat?

Note:

Undocumented in official API

Returns UTC offset in seconds.

Returns:

  • (Float, nil)

    UTC offset in seconds



150
# File 'lib/strava/models/summary_activity.rb', line 150

property 'utc_offset'

#visibilityString?

Note:

Undocumented in official API

Returns Activity visibility setting (e.g., 'everyone', 'followers_only').

Returns:

  • (String, nil)

    Activity visibility setting (e.g., 'everyone', 'followers_only')



146
# File 'lib/strava/models/summary_activity.rb', line 146

property 'visibility'

#weighted_average_wattsInteger?

Returns Weighted average power in watts.

Returns:

  • (Integer, nil)

    Weighted average power in watts



138
# File 'lib/strava/models/summary_activity.rb', line 138

property 'weighted_average_watts'

#workout_typeInteger?

Returns Workout type (e.g., 10 = Race, 11 = Workout).

Returns:

  • (Integer, nil)

    Workout type (e.g., 10 = Race, 11 = Workout)



105
# File 'lib/strava/models/summary_activity.rb', line 105

property 'workout_type'