Module: SAXMachine

Defined in:
lib/sax-machine.rb,
lib/sax-machine/sax_config.rb,
lib/sax-machine/sax_handler.rb,
lib/sax-machine/sax_document.rb,
lib/sax-machine/sax_element_config.rb,
lib/sax-machine/sax_collection_config.rb

Defined Under Namespace

Modules: ClassMethods Classes: SAXConfig, SAXHandler

Constant Summary collapse

VERSION =
"0.0.14"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
# File 'lib/sax-machine/sax_document.rb', line 5

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#parse(xml_text) ⇒ Object



9
10
11
12
13
14
# File 'lib/sax-machine/sax_document.rb', line 9

def parse(xml_text)
  sax_handler = SAXHandler.new(self)
  parser = Nokogiri::XML::SAX::Parser.new(sax_handler)
  parser.parse(xml_text)
  self
end