Sha256: 691500f336399ef667ffe7498a979722660eb6c7b280b7e7448e2c5f1954476d

Contents?: true

Size: 984 Bytes

Versions: 5

Compression:

Stored size: 984 Bytes

Contents

module Strava
  module Models
    class Route < Model
      include Mixins::Distance
      include Mixins::Elevation
      include Mixins::Time

      property 'id'
      property 'athlete', transform_with: ->(v) { Strava::Models::Athlete.new(v) }
      property 'name'
      property 'description'
      property 'total_elevation_gain', from: 'elevation_gain'
      property 'map', transform_with: ->(v) { Strava::Models::Map.new(v) }
      property 'private'
      property 'resource_state'
      property 'starred'
      property 'sub_type'
      property 'timestamp', transform_with: ->(v) { Time.at(v) }
      property 'created_at', transform_with: ->(v) { Time.parse(v) }
      property 'updated_at', transform_with: ->(v) { Time.parse(v) }
      property 'type'
      property 'estimated_moving_time'
      property 'moving_time', from: 'estimated_moving_time'
      property 'segments', transform_with: ->(v) { v.map { |r| Strava::Models::Segment.new(r) } }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
strava-ruby-client-0.4.2 lib/strava/models/route.rb
strava-ruby-client-0.4.1 lib/strava/models/route.rb
strava-ruby-client-0.4.0 lib/strava/models/route.rb
strava-ruby-client-0.3.2 lib/strava/models/route.rb
strava-ruby-client-0.3.1 lib/strava/models/route.rb