Class: ConfigMan::Item
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ConfigMan::Item
- Defined in:
- lib/config_man.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Item
constructor
A new instance of Item.
- #to_hash ⇒ Object
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_hash ⇒ Object
19 20 21 |
# File 'lib/config_man.rb', line 19 def to_hash @attributes end |