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.



31
32
33
34
35
36
37
# File 'lib/birdsong.rb', line 31

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.



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

def rate_limit
  @rate_limit
end

#rate_remainingObject (readonly)

Returns the value of attribute rate_remaining.



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

def rate_remaining
  @rate_remaining
end

#reset_time_leftObject (readonly)

Returns the value of attribute reset_time_left.



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

def reset_time_left
  @reset_time_left
end