Sha256: b64a059b675843261f03fbccf1afb0efa85c55beeb8ee809ff0fe2be88ad112d

Contents?: true

Size: 1.01 KB

Versions: 6

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

module Strava
  module Models
    class Route < Strava::Models::Response
      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

6 entries across 6 versions & 1 rubygems

Version Path
strava-ruby-client-2.2.0 lib/strava/models/route.rb
strava-ruby-client-2.1.0 lib/strava/models/route.rb
strava-ruby-client-2.0.0 lib/strava/models/route.rb
strava-ruby-client-1.1.0 lib/strava/models/route.rb
strava-ruby-client-1.0.1 lib/strava/models/route.rb
strava-ruby-client-1.0.0 lib/strava/models/route.rb