Class: EnvControl::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/env_control/configuration.rb

Constant Summary collapse

DEFAULT_BREACH_HANDLER =
lambda do |report|
  fail BreachOfContractError.new(context: { report: report })
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



16
17
18
19
20
# File 'lib/env_control/configuration.rb', line 16

def initialize
  @contract = {}
  @on_validation_error = DEFAULT_BREACH_HANDLER
  @validators_allowing_nil = [:deprecated, :empty, :ignore, :irrelevant, :not_set]
end

Instance Attribute Details

#contractObject

Returns the value of attribute contract.



10
11
12
# File 'lib/env_control/configuration.rb', line 10

def contract
  @contract
end

#environment_nameObject

Returns the value of attribute environment_name.



10
11
12
# File 'lib/env_control/configuration.rb', line 10

def environment_name
  @environment_name
end

#on_validation_errorObject

Returns the value of attribute on_validation_error.



9
10
11
# File 'lib/env_control/configuration.rb', line 9

def on_validation_error
  @on_validation_error
end

#validators_allowing_nilObject

Returns the value of attribute validators_allowing_nil.



9
10
11
# File 'lib/env_control/configuration.rb', line 9

def validators_allowing_nil
  @validators_allowing_nil
end