Class: Usps::Api::Errors::TooManyRequestsError
- Inherits:
-
Faraday::Error
- Object
- Faraday::Error
- Usps::Api::Errors::TooManyRequestsError
- Defined in:
- lib/usps/api/errors/too_many_requests_error.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ TooManyRequestsError
constructor
A new instance of TooManyRequestsError.
- #message ⇒ Object
- #retry_after ⇒ Object
Constructor Details
#initialize(response) ⇒ TooManyRequestsError
Returns a new instance of TooManyRequestsError.
8 9 10 |
# File 'lib/usps/api/errors/too_many_requests_error.rb', line 8 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/usps/api/errors/too_many_requests_error.rb', line 6 def response @response end |
Instance Method Details
#message ⇒ Object
12 13 14 |
# File 'lib/usps/api/errors/too_many_requests_error.rb', line 12 def "Retry after #{retry_after} seconds" end |
#retry_after ⇒ Object
16 17 18 |
# File 'lib/usps/api/errors/too_many_requests_error.rb', line 16 def retry_after response.headers['retry-after'].to_i end |