Module: Strava::Api::Endpoints::SegmentEfforts
- Included in:
- Client
- Defined in:
- lib/strava/api/endpoints/segment_efforts.rb
Overview
API endpoints for Strava segment efforts.
Segment efforts represent an athlete's attempt on a specific segment during an activity. Each time an activity passes through a segment, a segment effort is created with details like elapsed time, distance, and ranking information.
Instance Method Summary collapse
-
#segment_effort(id_or_options, options = {}) ⇒ Object
Returns a segment effort from an activity that is owned by the authenticated athlete.
-
#segment_efforts(id_or_options, options = {}, &block) ⇒ Object
Returns a set of the authenticated athlete's segment efforts for a given segment.
Instance Method Details
#segment_effort(id_or_options, options = {}) ⇒ Object
Returns a segment effort from an activity that is owned by the authenticated athlete.
22 23 24 25 |
# File 'lib/strava/api/endpoints/segment_efforts.rb', line 22 def segment_effort(, = {}) id, = parse_args(, ) Strava::Models::DetailedSegmentEffort.new(get("segment_efforts/#{id}", )) end |
#segment_efforts(id_or_options, options = {}, &block) ⇒ Object
Returns a set of the authenticated athlete's segment efforts for a given segment.
35 36 37 38 |
# File 'lib/strava/api/endpoints/segment_efforts.rb', line 35 def segment_efforts(, = {}, &block) id, = parse_args(, ) paginate "segments/#{id}/all_efforts", , Strava::Models::DetailedSegmentEffort, &block end |