Class: ConfigMan::Loader

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/config_man.rb

Instance Method Summary collapse

Constructor Details

#initialize(contents) ⇒ Loader

Returns a new instance of Loader.



25
26
27
28
29
30
31
32
# File 'lib/config_man.rb', line 25

def initialize(contents)
  struct = YAML.load(contents).map do |k,v|
    v = Item.new(symbolize_keys(v)) if v.is_a? Hash
    [k,v]
  end

  super(Item.new(Hash[struct]))
end