Class: DopCommon::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/dop_common/configuration.rb

Instance Method Summary collapse

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