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