lib/strava/models/segment.rb in strava-ruby-client-0.2.0 vs lib/strava/models/segment.rb in strava-ruby-client-0.3.0
- old
+ new
@@ -1,9 +1,11 @@
module Strava
module Models
class Segment < Model
- include Mixins::Distance
+ include Mixins::MetricDistance
+ include Mixins::Elevation
+ include Mixins::Time
property 'id'
property 'resource_state'
property 'name'
property 'maximum_grade'
@@ -22,12 +24,22 @@
property 'end_latitude'
property 'end_longitude'
property 'private'
property 'hazardous'
property 'starred'
+ property 'created_at', transform_with: ->(v) { Time.parse(v) }
+ property 'updated_at', transform_with: ->(v) { Time.parse(v) }
+ property 'map', transform_with: ->(v) { Strava::Models::Map.new(v) }
+ property 'effort_count'
+ property 'athlete_count'
+ property 'star_count'
+ property 'athlete_segment_stats', transform_with: ->(v) { Strava::Models::SegmentStats.new(v) }
+ property 'pr_time'
+ property 'athlete_pr_effort', transform_with: ->(v) { Strava::Models::SegmentEffort.new(v) }
+ property 'starred_date', transform_with: ->(v) { Time.parse(v) }
- def units
- :metric
+ def elapsed_time
+ pr_time
end
end
end
end