lib/ultra_config/namespace.rb in ultra_config-0.7.0 vs lib/ultra_config/namespace.rb in ultra_config-0.8.0

- old
+ new

@@ -47,7 +47,20 @@ output = '{ ' @objects.each { |name, object| objs << "#{name}: #{object.to_s}" } output << objs.join(', ') output << ' }' end + + def to_h + hash = {} + @objects.each do |name, object| + if object.is_a?(Config) + hash[name] = object.value + else + hash[name] = object.to_h + end + end + + hash + end end end \ No newline at end of file