lib/strava/models/activity.rb in strava-ruby-client-1.1.0 vs lib/strava/models/activity.rb in strava-ruby-client-2.0.0
- old
+ new
@@ -11,11 +11,10 @@
property 'id'
property 'resource_state'
property 'athlete', transform_with: ->(v) { Strava::Models::Athlete.new(v) }
property 'name'
property 'description'
- property 'type' # deprecated
property 'sport_type'
property 'workout_type'
property 'id'
property 'external_id'
property 'upload_id'
@@ -78,19 +77,19 @@
property 'highlighted_kudosers', transform_with: ->(v) { v.map { |r| Strava::Models::Kudoser.new(r) } }
property 'segment_leaderboard_opt_out'
property 'leaderboard_opt_out'
def distance_s
- if type == 'Swim'
+ if sport_type == 'Swim'
distance_in_meters_s
else
distance_in_kilometers_s
end
end
def pace_s
- case type
+ case sport_type
when 'Swim'
pace_per_100_meters_s
else
pace_per_kilometer_s
end
@@ -135,47 +134,9 @@
when 'WeightTraining' then 'ποΈ'
when 'Wheelchair' then 'βΏ'
# when 'Windsurf' then ''
# when 'Workout' then ''
when 'Yoga' then 'π§'
- end
- end
-
- #
- # @deprecated Use {#sport_type_emoji} instead.
- #
- # @return [String] precisely an emoji
- #
- def type_emoji
- case type
- 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 '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 'WeightTraining' then 'ποΈ'
- # when 'Windsurf' then ''
- when 'Wheelchair' then 'βΏ'
- # when 'Workout' then ''
- # when 'Yoga'' then ''
end
end
end
end
end