Sha256: f312f14f936b68998b271c360cad31d61e0a5b09bb22cbd67037fcf5715e3319

Contents?: true

Size: 473 Bytes

Versions: 1

Compression:

Stored size: 473 Bytes

Contents

require 'strava/v2/models/effort'

module Strava
  module V2
    module EffortsRequest
      def efforts_path(id)
        "rides/#{id}/efforts"
      end

      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
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
strava-api-v2-0.1 lib/strava/v2/efforts_request.rb