Exception: Birdsong::RateLimitExceeded

Inherits:
Error
  • Object
show all
Defined in:
lib/birdsong.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_limitObject (readonly)

Returns the value of attribute rate_limit.



28
29
30
# File 'lib/birdsong.rb', line 28

def rate_limit
  @rate_limit
end

#rate_remainingObject (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_leftObject (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