Class: Alula::RateLimit

Inherits:
Object
  • Object
show all
Defined in:
lib/alula/rate_limit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_limitObject

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_remainingObject

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_inObject

Returns the value of attribute reset_in.



3
4
5
# File 'lib/alula/rate_limit.rb', line 3

def reset_in
  @reset_in
end