Class: Strava::V1::Segment

Inherits:
Object
  • Object
show all
Defined in:
lib/strava/v1/models/segment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#effortsObject (readonly)

Returns the value of attribute efforts.



6
7
8
# File 'lib/strava/v1/models/segment.rb', line 6

def efforts
  @efforts
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/strava/v1/models/segment.rb', line 6

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/strava/v1/models/segment.rb', line 6

def name
  @name
end