Class: DopCommon::Configuration
- Inherits:
-
Object
- Object
- DopCommon::Configuration
- Defined in:
- lib/dop_common/configuration.rb
Instance Method Summary collapse
-
#initialize(hash) ⇒ Configuration
constructor
A new instance of Configuration.
- #lookup(source, key, scope) ⇒ Object
Constructor Details
#initialize(hash) ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 |
# File 'lib/dop_common/configuration.rb', line 11 def initialize(hash) @hash = hash end |
Instance Method Details
#lookup(source, key, scope) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/dop_common/configuration.rb', line 15 def lookup(source, key, scope) element = traverse_hash(source) if element.has_key?(key) element[key] else raise DopCommon::ConfigurationValueNotFound end rescue => e raise DopCommon::ConfigurationValueNotFound end |