lib/endicia_ruby/request.rb in endicia_ruby-0.2.2 vs lib/endicia_ruby/request.rb in endicia_ruby-0.2.3

- old
+ new

@@ -104,21 +104,25 @@ # Build nodes for the given xml builder recursively from a Hash def recursive_build_xml_nodes!(xml, nodes) nodes.each do |key, value| node_name = key.to_s.sub(/^./,&:upcase) # convert "fooBar" to "FooBar" case value - when Hash - xml.send(node_name) do - recursive_build_xml_nodes!(xml, value) - end - when Array - xml.send(node_name) do - value.each do |v| - recursive_build_xml_nodes!(xml, v) + when Hash + if node_name == 'ResponseOptions' + xml.ResponseOptions(value) + else + xml.send(node_name) do + recursive_build_xml_nodes!(xml, value) + end end - end - else - xml.send(node_name, value) + when Array + xml.send(node_name) do + value.each do |v| + recursive_build_xml_nodes!(xml, v) + end + end + else + xml.send(node_name, value) end end end # The Test attribute for the root node of the XML request