Module: StravaApi::Segments
- Included in:
- Base
- Defined in:
- lib/strava-api/segments.rb
Instance Method Summary collapse
- #segment_efforts(id, options = {}) ⇒ Object
- #segment_show(id) ⇒ Object
-
#segments(name) ⇒ Object
returns all segments, don’t need an offset.
Instance Method Details
#segment_efforts(id, options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/strava-api/segments.rb', line 16 def segment_efforts(id, = {}) = { :club_id => 'clubId', :athlete_id => 'athleteId', :athlete_name => 'athleteName', :start_date => 'startDate', :end_date => 'endDate', :start_id => 'startId', :best => 'best', :offset => 'offset' } #convert between rails format names and camel case = {} .each_pair do |key, converted| [converted] = [key] if [key] end result = call("segments/#{id}/efforts", "efforts", ) result["efforts"].collect {|effort| Effort.new(self, effort)} end |