Exception: IpApiIo::RateLimitError
- Defined in:
- lib/ipapi_io/errors.rb
Overview
HTTP 429 — quota exhausted. Exposes the x-ratelimit-* response headers; reset is the unix timestamp when the quota renews. The client never retries.
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 Error
Instance Method Summary collapse
-
#initialize(message, status_code: 429, body: nil, limit: nil, remaining: nil, reset: nil) ⇒ RateLimitError
constructor
A new instance of RateLimitError.
Constructor Details
#initialize(message, status_code: 429, body: nil, limit: nil, remaining: nil, reset: nil) ⇒ RateLimitError
Returns a new instance of RateLimitError.
21 22 23 24 25 26 |
# File 'lib/ipapi_io/errors.rb', line 21 def initialize(, status_code: 429, body: nil, limit: nil, remaining: nil, reset: nil) super(, status_code: status_code, body: body) @limit = limit @remaining = remaining @reset = reset end |
Instance Attribute Details
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
19 20 21 |
# File 'lib/ipapi_io/errors.rb', line 19 def limit @limit end |
#remaining ⇒ Object (readonly)
Returns the value of attribute remaining.
19 20 21 |
# File 'lib/ipapi_io/errors.rb', line 19 def remaining @remaining end |
#reset ⇒ Object (readonly)
Returns the value of attribute reset.
19 20 21 |
# File 'lib/ipapi_io/errors.rb', line 19 def reset @reset end |