Class: Feedlr::RateLimit
- Inherits:
-
Object
- Object
- Feedlr::RateLimit
- Defined in:
- lib/feedlr/rate_limit.rb
Overview
Rate limiting object associated with responses
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#remaining ⇒ Object
readonly
Returns the value of attribute remaining.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Feedlr::RateLimit
constructor
Initializes a new object.
Constructor Details
#initialize(attrs = {}) ⇒ Feedlr::RateLimit
Initializes a new object
12 13 14 15 16 17 18 19 |
# File 'lib/feedlr/rate_limit.rb', line 12 def initialize(attrs = {}) @count = attrs['x-ratelimit-count'].to_i if attrs['x-ratelimit-count'] @limit = attrs['x-ratelimit-limit'].to_i if attrs['x-ratelimit-limit'] @remaining = attrs['x-ratelimit-remaining'].to_i if attrs['x-ratelimit-remaining'] end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
4 5 6 |
# File 'lib/feedlr/rate_limit.rb', line 4 def count @count end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
4 5 6 |
# File 'lib/feedlr/rate_limit.rb', line 4 def limit @limit end |
#remaining ⇒ Object (readonly)
Returns the value of attribute remaining.
4 5 6 |
# File 'lib/feedlr/rate_limit.rb', line 4 def remaining @remaining end |