Exception: ApiKeys::Errors::KeyLimitExceededError

Inherits:
BaseError
  • Object
show all
Defined in:
lib/api_keys/errors.rb

Overview

Raised when key limit per type/environment is exceeded

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key_type:, environment:, limit:) ⇒ KeyLimitExceededError

Returns a new instance of KeyLimitExceededError.



52
53
54
55
56
57
# File 'lib/api_keys/errors.rb', line 52

def initialize(key_type:, environment:, limit:)
  @key_type = key_type
  @environment = environment
  @limit = limit
  super("Maximum number of #{key_type} keys (#{limit}) reached for #{environment} environment")
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



50
51
52
# File 'lib/api_keys/errors.rb', line 50

def environment
  @environment
end

#key_typeObject (readonly)

Returns the value of attribute key_type.



50
51
52
# File 'lib/api_keys/errors.rb', line 50

def key_type
  @key_type
end

#limitObject (readonly)

Returns the value of attribute limit.



50
51
52
# File 'lib/api_keys/errors.rb', line 50

def limit
  @limit
end