Method: CoreLibrary::XmlHelper.deserialize_xml

Defined in:
lib/apimatic-core/utilities/xml_helper.rb

.deserialize_xml(xml, root_element_name, clazz, datetime_format = nil) ⇒ Object

Deserializes XML to a specific class.

Parameters:

  • xml (String)

    The XML value to deserialize.

  • root_element_name (String)

    Root element name for the XML provided.

  • clazz (Class)

    The class to convert the XML into.

  • datetime_format (CoreLibrary::DateTimeFormat) (defaults to: nil)

    Datetime format to use for conversion..



140
141
142
143
144
# File 'lib/apimatic-core/utilities/xml_helper.rb', line 140

def deserialize_xml(xml, root_element_name, clazz, datetime_format = nil)
  doc = Nokogiri::XML::Document.parse xml
  from_element(doc, root_element_name, clazz,
               datetime_format: datetime_format)
end