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

Instance Method Details

#segment_effort(id_or_options, options = {}) ⇒ Object

Returns a segment effort from an activity that is owned by the authenticated athlete.

Parameters:

  • id_or_options (String, Integer, Hash)

    Either a segment effort ID or a hash of options including :id

  • options (Hash) (defaults to: {})

    Additional options (if first parameter is an ID)



22
23
24
25
# File 'lib/strava/api/endpoints/segment_efforts.rb', line 22

def segment_effort(id_or_options, options = {})
  id, options = parse_args(id_or_options, options)
  Strava::Models::DetailedSegmentEffort.new(get("segment_efforts/#{id}", options))
end

#segment_efforts(id_or_options, options = {}, &block) ⇒ Object

Returns a set of the authenticated athlete's segment efforts for a given segment.

Parameters:

  • id_or_options (String, Integer, Hash)

    Either a segment ID or a hash of options including :id

  • options (Hash) (defaults to: {})

    Additional options (if first parameter is an ID)

Options Hash (options):

  • :page (Integer)

    Page number

  • :per_page (Integer)

    Number of items per page. Defaults to 30



35
36
37
38
# File 'lib/strava/api/endpoints/segment_efforts.rb', line 35

def segment_efforts(id_or_options, options = {}, &block)
  id, options = parse_args(id_or_options, options)
  paginate "segments/#{id}/all_efforts", options, Strava::Models::DetailedSegmentEffort, &block
end