lib/xml/mapping_extensions.rb
# Create a new instance of this class from the XML contained in
# `xml`, which can be a string, REXML document, or REXML element
# @param xml [String, REXML::Document, REXML::Element]
# @return [Object] an instance of this class.
Create a new instance of this class from the XML contained in
`xml`, which can be a string, REXML document, or REXML element
Create a new instance of this class from the XML contained in ` xml ` which can be a string REXML document or REXML element
def parse_xml(xml, options = { mapping: :_default })
        element = case xml
                  when REXML::Document
                    xml.root
                  when REXML::Element
                    xml
                  else
                    raise ArgumentError, "Unexpected argument type; expected XML document, String, or IO source, was #{xml.class}" unless can_parse(xml)
                    REXML::Document.new(xml).root
                  end
        load_from_xml(element, options)
      end
def parse_xml ( xml , options = { mapping : :_default } ) element = case xml when REXML :: Document xml . root when REXML :: Element xml else raise ArgumentError , "Unexpected argument type; expected XML document, String, or IO source, was #{xml.class}" unless can_parse ( xml ) REXML :: Document . new ( xml ) . root end load_from_xml ( element , options ) end
Create a new instance of this class from the XML contained in
`xml`, which can be a string, REXML document, or REXML element
Create a new instance of this class from the XML contained in ` xml ` which can be a string REXML document or REXML element
an instance of this class.
an instance of this class .
Object
xml
<not_specific>
options
<not_specific>
<not_specific>
None