Class: StravaApi::Segment
- Inherits:
-
HashBasedStore
- Object
- HashBasedStore
- StravaApi::Segment
- Defined in:
- lib/strava-api/segment.rb
Overview
"name":"Panoramic to Pan Toll",
"id":156,
"climbCategory":"4",
"elevationGain":151.728,
"elevationHigh":458.206,
"elevationLow":304.395,
"distance":2378.34,
"averageGrade":6.50757
Constant Summary collapse
- ATTRIBUTE_MAP =
{ 'name' => :name, 'id' => :id, "climbCategory" => :climb_category, "elevationGain" => :elevation_gain, "elevationHigh" => :elevation_high, "elevationLow" => :elevation_low, "distance" => :distance, "averageGrade" => :average_grade }
Instance Method Summary collapse
- #efforts(options = {}) ⇒ Object
-
#initialize(connection, options = {}) ⇒ Segment
constructor
A new instance of Segment.
- #show ⇒ Object
Methods inherited from HashBasedStore
#[], #id, #merge, #method_missing, #to_s
Constructor Details
#initialize(connection, options = {}) ⇒ Segment
Returns a new instance of Segment.
23 24 25 |
# File 'lib/strava-api/segment.rb', line 23 def initialize(connection, = {}) super(connection, ATTRIBUTE_MAP, {}, ) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class StravaApi::HashBasedStore
Instance Method Details
#efforts(options = {}) ⇒ Object
32 33 34 |
# File 'lib/strava-api/segment.rb', line 32 def efforts( = {}) @connection.segment_efforts(self.id, ) end |
#show ⇒ Object
27 28 29 30 |
# File 'lib/strava-api/segment.rb', line 27 def show self.merge(@connection.segment_show(self.id)) self end |