Exception: SugarfreeConfig::ConfigKeyException

Inherits:
ConfigException show all
Defined in:
lib/sugarfree-config.rb

Overview

Exception raised by the Config Iterator when a key is not found

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key_path_elements) ⇒ ConfigKeyException

Create a new exception with the not found key paths (key_path_elements Array)



40
41
42
43
# File 'lib/sugarfree-config.rb', line 40

def initialize(key_path_elements)
  self.key_path_elements = [*key_path_elements].map(&:to_s)
  super("Cannot find key #{self.key_path_elements.join('.')}")
end

Instance Attribute Details

#key_path_elementsObject

Config key path (as a key collection) that failed



34
35
36
# File 'lib/sugarfree-config.rb', line 34

def key_path_elements
  @key_path_elements
end