In Ruby 1.9.2p0 'value' is a frozen string and fails to be assigned.

This commit is contained in:
Carles Pina 2012-12-12 12:10:07 +00:00
parent 4e2e5e9c68
commit 7864ad1829

View file

@ -63,7 +63,7 @@ def hash_to_xml(root,map)
map.each do |key,value|
element = REXML::Element.new(key)
if value.instance_of?(String)
element.text = value
element.text = value.dup
elsif value.instance_of?(Hash)
hash_to_xml(element,value)
elsif !value.nil?