Exception: RateLimit::Errors::LimitExceededError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rate_limit/errors/limit_exceeded_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ LimitExceededError

Returns a new instance of LimitExceededError.



10
11
12
13
14
# File 'lib/rate_limit/errors/limit_exceeded_error.rb', line 10

def initialize(result)
  @result = result

  super(custom_message)
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



6
7
8
# File 'lib/rate_limit/errors/limit_exceeded_error.rb', line 6

def result
  @result
end

Instance Method Details

#custom_messageObject



16
17
18
# File 'lib/rate_limit/errors/limit_exceeded_error.rb', line 16

def custom_message
  "#{result.topic}: has exceeded #{result.threshold} in #{result.interval} seconds"
end