Class: Alula::RateLimit
- Inherits:
-
Object
- Object
- Alula::RateLimit
- Defined in:
- lib/alula/rate_limit.rb
Instance Attribute Summary collapse
-
#request_limit ⇒ Object
Returns the value of attribute request_limit.
-
#requests_remaining ⇒ Object
Returns the value of attribute requests_remaining.
-
#reset_in ⇒ Object
Returns the value of attribute reset_in.
Instance Method Summary collapse
-
#initialize(headers) ⇒ RateLimit
constructor
A new instance of RateLimit.
Constructor Details
#initialize(headers) ⇒ RateLimit
Returns a new instance of RateLimit.
5 6 7 8 9 |
# File 'lib/alula/rate_limit.rb', line 5 def initialize(headers) self.request_limit = headers["x-rate-limit-limit"].to_i self.requests_remaining = headers["x-rate-limit-remaining"].to_i self.reset_in = headers["x-rate-limit-reset"].to_i end |
Instance Attribute Details
#request_limit ⇒ Object
Returns the value of attribute request_limit.
3 4 5 |
# File 'lib/alula/rate_limit.rb', line 3 def request_limit @request_limit end |
#requests_remaining ⇒ Object
Returns the value of attribute requests_remaining.
3 4 5 |
# File 'lib/alula/rate_limit.rb', line 3 def requests_remaining @requests_remaining end |
#reset_in ⇒ Object
Returns the value of attribute reset_in.
3 4 5 |
# File 'lib/alula/rate_limit.rb', line 3 def reset_in @reset_in end |