Exception: SolidusBactracs::Api::RateLimitedError

Inherits:
RequestError
  • Object
show all
Defined in:
lib/solidus_bactracs/api/rate_limited_error.rb

Instance Attribute Summary collapse

Attributes inherited from RequestError

#response_body, #response_code, #response_headers

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RequestError

from_response

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:, **options)
  super(**options)

  @retry_in = retry_in
end

Instance Attribute Details

#retry_inObject (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 options_from_response(response)
  super.merge(
    retry_in: response.headers['X-Rate-Limit-Reset'].to_i.seconds,
  )
end