allow hash keys to be symbols

This commit is contained in:
Laurent Sansonetti
2013-06-09 20:28:01 +02:00
parent 4f9dfe1402
commit acbd659388

View File

@@ -46,6 +46,7 @@ EOS
when Hash
str << indent_line("<dict>", indent)
plist.each do |key, val|
key = key.to_s if key.is_a?(Symbol)
raise "Hash key must be a string" unless key.is_a?(String)
str << indent_line("<key>#{key}</key>", indent + 1)
cat_element(val, str, indent + 1)