Module: Strava::V2::EffortsRequest

Included in:
Connection
Defined in:
lib/strava/v2/efforts_request.rb

Instance Method Summary collapse

Instance Method Details

#efforts_path(id) ⇒ Object



6
7
8
# File 'lib/strava/v2/efforts_request.rb', line 6

def efforts_path(id)
  "rides/#{id}/efforts"
end

#segments_for_ride(ride_id) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/strava/v2/efforts_request.rb', line 10

def segments_for_ride(ride_id)
  all_json = self.fetch(efforts_path(ride_id), {})

  all_segments = []
  all_json["efforts"].each { |effort_json|
    all_segments.push(Segment.new(effort_json["segment"], [effort_json["effort"]]))
  }
  all_segments
end