Exception: FlatApi::FlatRateLimitError
- Defined in:
- lib/flat_api/errors.rb
Overview
The account or IP exceeded its request quota. Returned as HTTP 403, not 429.
Instance Attribute Summary collapse
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#remaining ⇒ Object
readonly
Returns the value of attribute remaining.
-
#reset ⇒ Object
readonly
Returns the value of attribute reset.
Attributes inherited from FlatError
#body, #code, #headers, #request_id, #status
Instance Method Summary collapse
-
#initialize(message, **kwargs) ⇒ FlatRateLimitError
constructor
A new instance of FlatRateLimitError.
Methods inherited from FlatError
Constructor Details
#initialize(message, **kwargs) ⇒ FlatRateLimitError
Returns a new instance of FlatRateLimitError.
50 51 52 53 54 55 56 |
# File 'lib/flat_api/errors.rb', line 50 def initialize(, **kwargs) super @limit = int_header('X-RateLimit-Limit') @remaining = int_header('X-RateLimit-Remaining') # UTC epoch seconds at which the window resets. Flat sends no Retry-After header. @reset = int_header('X-RateLimit-Reset') end |
Instance Attribute Details
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
48 49 50 |
# File 'lib/flat_api/errors.rb', line 48 def limit @limit end |
#remaining ⇒ Object (readonly)
Returns the value of attribute remaining.
48 49 50 |
# File 'lib/flat_api/errors.rb', line 48 def remaining @remaining end |
#reset ⇒ Object (readonly)
Returns the value of attribute reset.
48 49 50 |
# File 'lib/flat_api/errors.rb', line 48 def reset @reset end |