Class: GeneratorLabs::RateLimitInfo
- Inherits:
-
Object
- Object
- GeneratorLabs::RateLimitInfo
- Defined in:
- lib/generatorlabs/rate_limit_info.rb
Overview
Rate limit information from API response headers.
Instance Attribute Summary collapse
-
#limit ⇒ String
readonly
Active rate limit policies, e.g.
-
#remaining ⇒ Integer
readonly
Requests remaining in the most restrictive active window.
-
#reset ⇒ Integer
readonly
Seconds until the most restrictive window resets.
Instance Method Summary collapse
-
#initialize(limit:, remaining:, reset:) ⇒ RateLimitInfo
constructor
A new instance of RateLimitInfo.
Constructor Details
#initialize(limit:, remaining:, reset:) ⇒ RateLimitInfo
Returns a new instance of RateLimitInfo.
24 25 26 27 28 |
# File 'lib/generatorlabs/rate_limit_info.rb', line 24 def initialize(limit:, remaining:, reset:) @limit = limit @remaining = remaining @reset = reset end |
Instance Attribute Details
#limit ⇒ String (readonly)
Returns Active rate limit policies, e.g. “1000;w=3600, 100;w=1”.
16 17 18 |
# File 'lib/generatorlabs/rate_limit_info.rb', line 16 def limit @limit end |
#remaining ⇒ Integer (readonly)
Returns Requests remaining in the most restrictive active window.
19 20 21 |
# File 'lib/generatorlabs/rate_limit_info.rb', line 19 def remaining @remaining end |
#reset ⇒ Integer (readonly)
Returns Seconds until the most restrictive window resets.
22 23 24 |
# File 'lib/generatorlabs/rate_limit_info.rb', line 22 def reset @reset end |