Exception: Quonfig::Errors::EnvVarParseError

Inherits:
Quonfig::Error
  • Object
show all
Defined in:
lib/quonfig/errors/env_var_parse_error.rb

Instance Method Summary collapse

Constructor Details

#initialize(env_var, config, env_var_name) ⇒ EnvVarParseError

Returns a new instance of EnvVarParseError.



6
7
8
9
10
11
12
13
14
15
# File 'lib/quonfig/errors/env_var_parse_error.rb', line 6

def initialize(env_var, config, env_var_name)
  key, value_type =
    if config.is_a?(Hash)
      [config[:key] || config['key'],
       config[:value_type] || config['value_type'] || config['valueType']]
    else
      [config.key, config.value_type]
    end
  super("Evaluating #{key} couldn't coerce #{env_var_name} of #{env_var} to #{value_type}")
end