-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathzones.rb
More file actions
42 lines (40 loc) · 1.49 KB
/
zones.rb
File metadata and controls
42 lines (40 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# frozen_string_literal: true
module Strava
module Models
#
# Represents an athlete's training zones configuration.
#
# Training zones are used to define intensity levels for heart rate and power.
# These zones help athletes train at specific intensities and track time spent
# in each zone during activities.
#
# @see https://developers.strava.com/docs/reference/#api-models-Zones Strava API Zones reference
# @see Strava::Models::HeartRateZoneRanges
# @see Strava::Models::PowerZoneRanges
# @see Strava::Api::Client#athlete_zones
#
# @example Accessing athlete's training zones
# zones = client.athlete_zones
#
# # Heart rate zones
# if zones.heart_rate
# zones.heart_rate.zones.each_with_index do |zone, i|
# puts "HR Zone #{i + 1}: #{zone.min}-#{zone.max} bpm"
# end
# end
#
# # Power zones
# if zones.power
# zones.power.zones.each_with_index do |zone, i|
# puts "Power Zone #{i + 1}: #{zone.min}-#{zone.max}W"
# end
# end
#
class Zones < Strava::Models::Response
# @return [HeartRateZoneRanges, nil] Heart rate zone configuration with zone ranges
property 'heart_rate', transform_with: ->(v) { Strava::Models::HeartRateZoneRanges.new(v) }
# @return [PowerZoneRanges, nil] Power zone configuration with zone ranges (for cyclists)
property 'power', transform_with: ->(v) { Strava::Models::PowerZoneRanges.new(v) }
end
end
end