Class: NRB::Untappd::API::RateLimit
- Inherits:
-
Object
- Object
- NRB::Untappd::API::RateLimit
- Defined in:
- lib/drink-socially/api/rate_limit.rb
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(headers) ⇒ RateLimit
constructor
A new instance of RateLimit.
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
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
6 7 8 |
# File 'lib/drink-socially/api/rate_limit.rb', line 6 def limit @limit end |
#remaining ⇒ Object (readonly)
Returns the value of attribute remaining.
6 7 8 |
# File 'lib/drink-socially/api/rate_limit.rb', line 6 def remaining @remaining end |