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 ''