Exception: SugarfreeConfig::ConfigKeyException
- Inherits:
-
ConfigException
- Object
- Exception
- ConfigException
- SugarfreeConfig::ConfigKeyException
- Defined in:
- lib/sugarfree-config.rb
Overview
Exception raised by the Config Iterator when a key is not found
Instance Attribute Summary collapse
-
#key_path_elements ⇒ Object
Config key path (as a key collection) that failed.
Instance Method Summary collapse
-
#initialize(key_path_elements) ⇒ ConfigKeyException
constructor
Create a new exception with the not found key paths (
key_path_elements
Array).
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_elements ⇒ Object
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 |