Module: Strava::Models::Mixins::HttpResponse

Extended by:
ActiveSupport::Concern
Included in:
Response
Defined in:
lib/strava/models/mixins/http_response.rb

Overview

Provides access to HTTP response data and rate limit information.

This mixin is included in Response (the base class for most API models) and provides access to the underlying HTTP response, which contains important metadata like rate limit information.

Examples:

Checking rate limits

activity = client.activity(1234567890)
ratelimit = activity.http_response.ratelimit

puts "15-min limit: #{ratelimit.fifteen_minutes_limit}"
puts "15-min used: #{ratelimit.fifteen_minutes_usage}"
puts "15-min remaining: #{ratelimit.fifteen_minutes_remaining}"

puts "Daily limit: #{ratelimit.daily_limit}"
puts "Daily used: #{ratelimit.daily_usage}"
puts "Daily remaining: #{ratelimit.daily_remaining}"

See Also: