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.



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

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



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

def key
  @key
end