Class: Strava::V1::Segment
- Inherits:
-
Object
- Object
- Strava::V1::Segment
- Defined in:
- lib/strava/v1/models/segment.rb
Instance Attribute Summary collapse
-
#efforts ⇒ Object
readonly
Returns the value of attribute efforts.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(jb, ejb) ⇒ Segment
constructor
ejb - efforts json, in list form.
Constructor Details
#initialize(jb, ejb) ⇒ Segment
ejb - efforts json, in list form
9 10 11 12 13 14 15 16 |
# File 'lib/strava/v1/models/segment.rb', line 9 def initialize(jb, ejb) @id = jb["id"] @name = jb["name"] @efforts = [] ejb.each { |effort_json| @efforts.push(Effort.new(effort_json)) } end |
Instance Attribute Details
#efforts ⇒ Object (readonly)
Returns the value of attribute efforts.
6 7 8 |
# File 'lib/strava/v1/models/segment.rb', line 6 def efforts @efforts end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/strava/v1/models/segment.rb', line 6 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/strava/v1/models/segment.rb', line 6 def name @name end |