Class: Strava::V2::Segment
- Inherits:
-
StravaResponse
- Object
- StravaResponse
- Strava::V2::Segment
- Defined in:
- lib/strava/v2/models/segment.rb
Instance Attribute Summary collapse
-
#average_grade ⇒ Object
readonly
Returns the value of attribute average_grade.
-
#climb_category ⇒ Object
readonly
Returns the value of attribute climb_category.
-
#efforts ⇒ Object
readonly
Returns the value of attribute efforts.
-
#end_latlng ⇒ Object
readonly
Returns the value of attribute end_latlng.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#start_latlng ⇒ Object
readonly
Returns the value of attribute start_latlng.
Instance Method Summary collapse
-
#initialize(jb, ejb) ⇒ Segment
constructor
include the efforts in the segment, if applicable jb - the json for the segment ejb - the json for the efforts, in a list.
Constructor Details
#initialize(jb, ejb) ⇒ Segment
include the efforts in the segment, if applicable jb - the json for the segment ejb - the json for the efforts, in a list
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/strava/v2/models/segment.rb', line 12 def initialize(jb, ejb) @id = jb["id"] @name = jb["name"] @climb_category = jb["climb_category"] @start_latlng = jb["start_latlng"] @end_latlng = jb["end_latlng"] @average_grade = jb["avg_grade"] @efforts = [] ejb.each { |effort_json| @efforts.push(Effort.new(effort_json)) } end |
Instance Attribute Details
#average_grade ⇒ Object (readonly)
Returns the value of attribute average_grade.
7 8 9 |
# File 'lib/strava/v2/models/segment.rb', line 7 def average_grade @average_grade end |
#climb_category ⇒ Object (readonly)
Returns the value of attribute climb_category.
7 8 9 |
# File 'lib/strava/v2/models/segment.rb', line 7 def climb_category @climb_category end |
#efforts ⇒ Object (readonly)
Returns the value of attribute efforts.
7 8 9 |
# File 'lib/strava/v2/models/segment.rb', line 7 def efforts @efforts end |
#end_latlng ⇒ Object (readonly)
Returns the value of attribute end_latlng.
7 8 9 |
# File 'lib/strava/v2/models/segment.rb', line 7 def end_latlng @end_latlng end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/strava/v2/models/segment.rb', line 7 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/strava/v2/models/segment.rb', line 7 def name @name end |
#start_latlng ⇒ Object (readonly)
Returns the value of attribute start_latlng.
7 8 9 |
# File 'lib/strava/v2/models/segment.rb', line 7 def start_latlng @start_latlng end |