Permalink
Browse files

simplified app to_xml_string serialization

  • Loading branch information...
1 parent 25fc01c commit 50adffb80e0e7da5833bb9206d14350e22973d7e @randym committed Sep 30, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/axlsx/doc_props/app.rb
@@ -223,7 +223,10 @@ def doc_security=(v) Axlsx::validate_int v; @doc_security = v; end
def to_xml_string(str = '')
str << '<?xml version="1.0" encoding="UTF-8"?>'
str << '<Properties xmlns="' << APP_NS << '" xmlns:vt="' << APP_NS_VT << '">'
- str << instance_values.map { |key, value| '<' << Axlsx.camel(key) << '>' << value.to_s << '</' << Axlsx.camel(key) << '>' }.join
+ instance_values.each do |key, value|
+ node_name = Axlsx.camel(key)
+ str << "<#{node_name}>#{value}</#{node_name}>"
+ end
str << '</Properties>'
end

0 comments on commit 50adffb

Please sign in to comment.