Class: NRB::Untappd::API::RateLimit

Inherits:
Object
  • Object
show all
Defined in:
lib/drink-socially/api/rate_limit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(headers) ⇒ RateLimit

Returns a new instance of RateLimit.



8
9
10
11
12
# File 'lib/drink-socially/api/rate_limit.rb', line 8

def initialize(headers)
  return unless headers.respond_to?(:[])
  @limit     = headers["x-ratelimit-limit"]
  @remaining = headers["x-ratelimit-remaining"]
end

Instance Attribute Details

#limitObject (readonly)

Returns the value of attribute limit.



6
7
8
# File 'lib/drink-socially/api/rate_limit.rb', line 6

def limit
  @limit
end

#remainingObject (readonly)

Returns the value of attribute remaining.



6
7
8
# File 'lib/drink-socially/api/rate_limit.rb', line 6

def remaining
  @remaining
end