lib/strava/models/activity.rb in strava-ruby-client-0.4.2 vs lib/strava/models/activity.rb in strava-ruby-client-0.4.3
- old
+ new
@@ -1,11 +1,14 @@
+# frozen_string_literal: true
+
module Strava
module Models
class Activity < Model
- include Mixins::Distance
include Mixins::Time
+ include Mixins::Distance
include Mixins::Elevation
+ include Mixins::StartDateLocal
property 'id'
property 'resource_state'
property 'athlete', transform_with: ->(v) { Strava::Models::Athlete.new(v) }
property 'name'
@@ -14,11 +17,10 @@
property 'workout_type'
property 'id'
property 'external_id'
property 'upload_id'
property 'start_date', transform_with: ->(v) { Time.parse(v) }
- property 'start_date_local', transform_with: ->(v) { Time.parse(v) }
property 'timezone'
property 'utc_offset'
property 'start_latlng'
property 'end_latlng'
property 'location_city'
@@ -97,19 +99,18 @@
"https://www.strava.com/activities/#{id}"
end
def type_emoji
case type
- when 'Run' then 'π'
- when 'Ride' then 'π΄'
+ when 'Run', 'VirtualRun' then 'π'
+ when 'Ride', 'EBikeRide', 'VirtualRide' 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 ''
@@ -121,11 +122,9 @@
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 ''