Class: Configature::Data
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Configature::Data
- Defined in:
- lib/configature/data.rb
Direct Known Subclasses
Class Method Summary collapse
-
.hashify(data) ⇒ Object
Class Methods ========================================================.
Instance Method Summary collapse
-
#to_h ⇒ Object
Instance Methods =====================================================.
Class Method Details
.hashify(data) ⇒ Object
Class Methods ========================================================
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/configature/data.rb', line 6 def self.hashify(data) case (data) when Configature::Data data.to_h when Array data.map do |v| hashify(v) end else data end end |
Instance Method Details
#to_h ⇒ Object
Instance Methods =====================================================
21 22 23 24 25 |
# File 'lib/configature/data.rb', line 21 def to_h super.map do |k, v| [ k, self.class.hashify(v) ] end.to_h end |