Class: Walinko::RateLimitSnapshot
- Inherits:
-
Object
- Object
- Walinko::RateLimitSnapshot
- Defined in:
- lib/walinko/result.rb
Overview
Snapshot of the server-reported rate-limit window from the most recent response.
Instance Attribute Summary collapse
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#remaining ⇒ Object
readonly
Returns the value of attribute remaining.
Instance Method Summary collapse
-
#initialize(limit:, remaining:) ⇒ RateLimitSnapshot
constructor
A new instance of RateLimitSnapshot.
- #saturated? ⇒ Boolean
Constructor Details
#initialize(limit:, remaining:) ⇒ RateLimitSnapshot
Returns a new instance of RateLimitSnapshot.
107 108 109 110 |
# File 'lib/walinko/result.rb', line 107 def initialize(limit:, remaining:) @limit = limit @remaining = remaining end |
Instance Attribute Details
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
105 106 107 |
# File 'lib/walinko/result.rb', line 105 def limit @limit end |
#remaining ⇒ Object (readonly)
Returns the value of attribute remaining.
105 106 107 |
# File 'lib/walinko/result.rb', line 105 def remaining @remaining end |
Instance Method Details
#saturated? ⇒ Boolean
112 113 114 |
# File 'lib/walinko/result.rb', line 112 def saturated? remaining.is_a?(Integer) && remaining <= 0 end |