Exception: SolidusBactracs::Api::RateLimitedError
- Inherits:
-
RequestError
- Object
- RuntimeError
- RequestError
- SolidusBactracs::Api::RateLimitedError
- Defined in:
- lib/solidus_bactracs/api/rate_limited_error.rb
Instance Attribute Summary collapse
-
#retry_in ⇒ Object
readonly
Returns the value of attribute retry_in.
Attributes inherited from RequestError
#response_body, #response_code, #response_headers
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(retry_in:, **options) ⇒ RateLimitedError
constructor
A new instance of RateLimitedError.
Methods inherited from RequestError
Constructor Details
#initialize(retry_in:, **options) ⇒ RateLimitedError
Returns a new instance of RateLimitedError.
16 17 18 19 20 |
# File 'lib/solidus_bactracs/api/rate_limited_error.rb', line 16 def initialize(retry_in:, **) super(**) @retry_in = retry_in end |
Instance Attribute Details
#retry_in ⇒ Object (readonly)
Returns the value of attribute retry_in.
6 7 8 |
# File 'lib/solidus_bactracs/api/rate_limited_error.rb', line 6 def retry_in @retry_in end |
Class Method Details
.options_from_response(response) ⇒ Object
9 10 11 12 13 |
# File 'lib/solidus_bactracs/api/rate_limited_error.rb', line 9 def (response) super.merge( retry_in: response.headers['X-Rate-Limit-Reset'].to_i.seconds, ) end |