lib/hash-tree.rb in hash-tree-0.0.3 vs lib/hash-tree.rb in hash-tree-0.0.4
- old
+ new
@@ -30,11 +30,12 @@
from_json File.read(json_path)
end
def self.from_xml(xml_data)
return nil if xml_data.to_s.empty?
-
- tree = self.new(Nori.parse(xml_data))
+
+ parser = Nori.new
+ tree = self.new(parser.parse(xml_data))
tree.replace_values!(nil, '')
return tree
end