Class: Strava::Models::SummaryPRSegmentEffort

Inherits:
Response show all
Defined in:
lib/strava/models/summary_pr_segment_effort.rb

Overview

Represents an athlete's personal record (PR) on a segment.

Contains information about the athlete's best effort on a particular segment, including when it was achieved and how many times they've attempted the segment.

Examples:

Accessing PR information from a segment

segment = client.segment(1234567)
if segment.athlete_pr_effort
  pr = segment.athlete_pr_effort
  puts "Your PR: #{pr.pr_elapsed_time} seconds"
  puts "Set on: #{pr.pr_date}"
  puts "Total attempts: #{pr.effort_count}"
end

See Also:

Instance Method Summary collapse

Instance Method Details

#effort_countInteger

Returns Total number of times the athlete has attempted this segment.

Returns:

  • (Integer)

    Total number of times the athlete has attempted this segment



35
# File 'lib/strava/models/summary_pr_segment_effort.rb', line 35

property 'effort_count'

#pr_activity_idInteger?

Returns Activity ID where the PR was achieved.

Returns:

  • (Integer, nil)

    Activity ID where the PR was achieved



26
# File 'lib/strava/models/summary_pr_segment_effort.rb', line 26

property 'pr_activity_id'

#pr_activity_visibilityString?

Note:

Not documented by Strava API

Returns Visibility setting for the activity containing the PR.

Returns:

  • (String, nil)

    Visibility setting for the activity containing the PR



43
# File 'lib/strava/models/summary_pr_segment_effort.rb', line 43

property 'pr_activity_visibility'

#pr_dateDate?

Returns Date when the PR was set.

Returns:

  • (Date, nil)

    Date when the PR was set



32
# File 'lib/strava/models/summary_pr_segment_effort.rb', line 32

property 'pr_date', transform_with: ->(v) { Date.parse(v) }

#pr_elapsed_timeInteger?

Returns Elapsed time for the PR effort in seconds.

Returns:

  • (Integer, nil)

    Elapsed time for the PR effort in seconds



29
# File 'lib/strava/models/summary_pr_segment_effort.rb', line 29

property 'pr_elapsed_time'

#pr_visibilityString?

Note:

Not documented by Strava API

Returns Visibility setting for the PR effort.

Returns:

  • (String, nil)

    Visibility setting for the PR effort



39
# File 'lib/strava/models/summary_pr_segment_effort.rb', line 39

property 'pr_visibility'