Class: Array

Inherits:
Object show all
Defined in:
lib/savon/core_ext/array.rb

Instance Method Summary collapse

Instance Method Details

#to_soap_xml(key) ⇒ Object

Translates the Array into SOAP request compatible XML. See: Hash#to_soap_xml.



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/savon/core_ext/array.rb', line 4

def to_soap_xml(key)
  xml = Builder::XmlMarkup.new

  each do |item|
    case item
      when Array, Hash then xml.tag!(key) { xml << item.to_soap_xml }
      else                  xml.tag!(key) { xml << item.to_soap_value }
    end
  end

  xml.target!
end