Class: Strava::Web::ApiResponse
- Inherits:
-
Object
- Object
- Strava::Web::ApiResponse
- Defined in:
- lib/strava/web/api_response.rb
Overview
Wraps an HTTP response with rate limit information.
This class provides access to both the raw HTTP response and parsed rate limit data from the response headers.
Instance Attribute Summary collapse
-
#ratelimit ⇒ Strava::Api::Ratelimit
Rate limit information extracted from response headers.
-
#response ⇒ Faraday::Response
The raw HTTP response.
Instance Method Summary collapse
-
#initialize(http_response) ⇒ ApiResponse
constructor
Initialize a new ApiResponse with an HTTP response.
Constructor Details
#initialize(http_response) ⇒ ApiResponse
Initialize a new ApiResponse with an HTTP response.
37 38 39 40 |
# File 'lib/strava/web/api_response.rb', line 37 def initialize(http_response) @response = http_response @ratelimit = Strava::Api::Ratelimit.new(http_response) end |
Instance Attribute Details
#ratelimit ⇒ Strava::Api::Ratelimit
Returns Rate limit information extracted from response headers.
30 31 32 |
# File 'lib/strava/web/api_response.rb', line 30 def ratelimit @ratelimit end |
#response ⇒ Faraday::Response
Returns The raw HTTP response.
27 28 29 |
# File 'lib/strava/web/api_response.rb', line 27 def response @response end |