Class: EnvControl::Configuration
- Inherits:
-
Object
- Object
- EnvControl::Configuration
- 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
-
#contract ⇒ Object
Returns the value of attribute contract.
-
#environment_name ⇒ Object
Returns the value of attribute environment_name.
-
#on_validation_error ⇒ Object
Returns the value of attribute on_validation_error.
-
#validators_allowing_nil ⇒ Object
Returns the value of attribute validators_allowing_nil.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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
#contract ⇒ Object
Returns the value of attribute contract.
10 11 12 |
# File 'lib/env_control/configuration.rb', line 10 def contract @contract end |
#environment_name ⇒ Object
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_error ⇒ Object
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_nil ⇒ Object
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 |