123456789_123456789_123456789_123456789_123456789_

Module: ActiveSupport::XmlMini_LibXML

Do not use. This module is for internal use only.
Relationships & Source Files
Defined in: activesupport/lib/active_support/xml_mini/libxml.rb

Instance Method Summary

Instance Method Details

#parse(data)

Parse an XML Document string or ::IO into a simple hash using libxml.

data

XML Document string or IO to parse

[ GitHub ]

  
# File 'activesupport/lib/active_support/xml_mini/libxml.rb', line 14

def parse(data)
  if !data.respond_to?(:read)
    data = StringIO.new(data || "")
  end

  if data.eof?
    {}
  else
    LibXML::XML::Parser.io(data).parse.to_hash
  end
end