Exception: ApiKeys::Errors::InvalidEnvironmentError

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

Overview

Raised when an invalid environment is specified

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment:, valid_environments:) ⇒ InvalidEnvironmentError

Returns a new instance of InvalidEnvironmentError.



41
42
43
44
45
# File 'lib/api_keys/errors.rb', line 41

def initialize(environment:, valid_environments:)
  @environment = environment
  @valid_environments = valid_environments
  super("Invalid environment '#{environment}'. Valid environments: #{valid_environments.join(', ')}")
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



39
40
41
# File 'lib/api_keys/errors.rb', line 39

def environment
  @environment
end

#valid_environmentsObject (readonly)

Returns the value of attribute valid_environments.



39
40
41
# File 'lib/api_keys/errors.rb', line 39

def valid_environments
  @valid_environments
end