Class: Strava::Models::Activity

Inherits:
Strava::Model show all
Includes:
Mixins::Distance, Mixins::Elevation, Mixins::Time
Defined in:
lib/strava/models/activity.rb

Instance Method Summary collapse

Methods included from Mixins::Elevation

#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::Time

#average_speed_meters_per_second, #elapsed_time_in_hours_s, #kilometer_per_hour_s, #miles_per_hour_s, #moving_time_in_hours_s, #pace_per_100_meters_s, #pace_per_100_yards_s, #pace_per_kilometer_s, #pace_per_mile_s, #speed_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

Instance Method Details

#distance_sObject



79
80
81
82
83
84
85
# File 'lib/strava/models/activity.rb', line 79

def distance_s
  if type == 'Swim'
    distance_in_meters_s
  else
    distance_in_kilometers_s
  end
end

#pace_sObject



87
88
89
90
91
92
93
94
# File 'lib/strava/models/activity.rb', line 87

def pace_s
  case type
  when 'Swim'
    pace_per_100_meters_s
  else
    pace_per_kilometer_s
  end
end

#strava_urlObject



96
97
98
# File 'lib/strava/models/activity.rb', line 96

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

#type_emojiObject



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/strava/models/activity.rb', line 100

def type_emoji
  case type
  when 'Run' then 'πŸƒ'
  when 'Ride' then '🚴'
  when 'Swim' then '🏊'
  when 'Walk' then '🚢'
  when 'AlpineSki' then '⛷️'
  when 'BackcountrySki' then '🎿️'
  # when 'Canoeing' then ''
  # when 'Crossfit' then ''
  when 'EBikeRide' then '🚴'
  # when 'Elliptical' then ''
  # when 'Hike' then ''
  when 'IceSkate' then '⛸️'
  # when 'InlineSkate' then ''
  # when 'Kayaking' then ''
  # when 'Kitesurf' then ''
  # when 'NordicSki' then ''
  when 'RockClimbing' then 'πŸ§—'
  when 'RollerSki' then ''
  when 'Rowing' then '🚣'
  when 'Snowboard' then 'πŸ‚'
  # when 'Snowshoe' then ''
  # when 'StairStepper' then ''
  # when 'StandUpPaddling' then ''
  when 'Surfing' then 'πŸ„'
  when 'VirtualRide' then '🚴'
  when 'VirtualRun' then 'πŸƒ'
  when 'WeightTraining' then 'πŸ‹οΈ'
  # when 'Windsurf' then ''
  when 'Wheelchair' then 'β™Ώ'
    # when 'Workout' then ''
    # when 'Yoga'' then ''
  end
end