Class: Strava::V1::Ride

Inherits:
StravaResponse show all
Defined in:
lib/strava/v1/models/ride.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Ride

Returns a new instance of Ride.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/strava/v1/models/ride.rb', line 10

def initialize(json)
  @id = json["id"]
  @name = json["name"]
  @distance = json["distance"]
  @moving_time = json["moving_time"]
  @average_speed = json["average_speed"]
  @average_watts = json["average_watts"]
  @name = json["name"]
  @elevation_gain = json["elevationGain"]
  @athlete = Athlete.new(json["athlete"]) if !json["athlete"].nil?
end

Instance Attribute Details

#athleteObject (readonly)

Returns the value of attribute athlete.



7
8
9
# File 'lib/strava/v1/models/ride.rb', line 7

def athlete
  @athlete
end

#average_speedObject (readonly)

Returns the value of attribute average_speed.



7
8
9
# File 'lib/strava/v1/models/ride.rb', line 7

def average_speed
  @average_speed
end

#average_wattsObject (readonly)

Returns the value of attribute average_watts.



7
8
9
# File 'lib/strava/v1/models/ride.rb', line 7

def average_watts
  @average_watts
end

#distanceObject (readonly)

Returns the value of attribute distance.



7
8
9
# File 'lib/strava/v1/models/ride.rb', line 7

def distance
  @distance
end

#elevation_gainObject (readonly)

Returns the value of attribute elevation_gain.



7
8
9
# File 'lib/strava/v1/models/ride.rb', line 7

def elevation_gain
  @elevation_gain
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/strava/v1/models/ride.rb', line 7

def id
  @id
end

#moving_timeObject (readonly)

Returns the value of attribute moving_time.



7
8
9
# File 'lib/strava/v1/models/ride.rb', line 7

def moving_time
  @moving_time
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/strava/v1/models/ride.rb', line 7

def name
  @name
end

#segmentsObject

Returns the value of attribute segments.



8
9
10
# File 'lib/strava/v1/models/ride.rb', line 8

def segments
  @segments
end