Module: ActiveSupport::XmlMini_NokogiriSAX

Extended by:
XmlMini_NokogiriSAX
Included in:
XmlMini_NokogiriSAX
Defined in:
lib/active_support/xml_mini/nokogirisax.rb

Defined Under Namespace

Classes: HashBuilder

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#document_classObject

Returns the value of attribute document_class.



62
63
64
# File 'lib/active_support/xml_mini/nokogirisax.rb', line 62

def document_class
  @document_class
end

Instance Method Details

#parse(string) ⇒ Object



65
66
67
68
69
70
71
# File 'lib/active_support/xml_mini/nokogirisax.rb', line 65

def parse(string)
  return {} if string.blank?
  document = self.document_class.new
  parser = Nokogiri::XML::SAX::Parser.new(document)
  parser.parse(string)
  document.hash
end