Exception: Birdsong::RateLimitExceeded
- Defined in:
- lib/birdsong.rb
Instance Attribute Summary collapse
-
#rate_limit ⇒ Object
readonly
Returns the value of attribute rate_limit.
-
#rate_remaining ⇒ Object
readonly
Returns the value of attribute rate_remaining.
-
#reset_time_left ⇒ Object
readonly
Returns the value of attribute reset_time_left.
Instance Method Summary collapse
-
#initialize(rate_limit, rate_remaining, reset_time) ⇒ RateLimitExceeded
constructor
A new instance of RateLimitExceeded.
Constructor Details
#initialize(rate_limit, rate_remaining, reset_time) ⇒ RateLimitExceeded
Returns a new instance of RateLimitExceeded.
32 33 34 35 36 37 38 |
# File 'lib/birdsong.rb', line 32 def initialize(rate_limit, rate_remaining, reset_time) @rate_limit = rate_limit @rate_remaining = rate_remaining @reset_time_left = reset_time.to_i - Time.now.to_i super("Rate Limit Exceeded: Limit #{rate_limit}, Remaining #{rate_remaining}, Time Left #{reset_time_left}") end |
Instance Attribute Details
#rate_limit ⇒ Object (readonly)
Returns the value of attribute rate_limit.
28 29 30 |
# File 'lib/birdsong.rb', line 28 def rate_limit @rate_limit end |
#rate_remaining ⇒ Object (readonly)
Returns the value of attribute rate_remaining.
29 30 31 |
# File 'lib/birdsong.rb', line 29 def rate_remaining @rate_remaining end |
#reset_time_left ⇒ Object (readonly)
Returns the value of attribute reset_time_left.
30 31 32 |
# File 'lib/birdsong.rb', line 30 def reset_time_left @reset_time_left end |