Exception: Philiprehberger::RateLimiter::RateLimitExceeded

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

Overview

Raised by allow! when the rate limit is exceeded

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ RateLimitExceeded

Returns a new instance of RateLimitExceeded.



18
19
20
21
# File 'lib/philiprehberger/rate_limiter.rb', line 18

def initialize(key)
  @key = key
  super("Rate limit exceeded for #{key}")
end

Instance Attribute Details

#keyString (readonly)

Returns the key that was rate-limited.

Returns:

  • (String)

    the key that was rate-limited



16
17
18
# File 'lib/philiprehberger/rate_limiter.rb', line 16

def key
  @key
end