Class: ConfigMan::Item

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Item

Returns a new instance of Item.



8
9
10
11
12
13
14
15
16
17
# File 'lib/config_man.rb', line 8

def initialize(attributes)
  @attributes = attributes

  attributes = attributes.map do |k,v|
    v = self.class.new(v) if v.is_a? Hash
    [k,v]
  end

  super(attributes)
end

Instance Method Details

#to_hashObject



19
20
21
# File 'lib/config_man.rb', line 19

def to_hash
  @attributes
end