Class: XmlHasher::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/xmlhasher/parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Parser

Returns a new instance of Parser.



6
7
8
# File 'lib/xmlhasher/parser.rb', line 6

def initialize(options = {})
  @options = options
end

Instance Method Details

#parse(xml) ⇒ Object



10
11
12
13
14
# File 'lib/xmlhasher/parser.rb', line 10

def parse(xml)
  handler = Handler.new(@options)
  Ox.sax_parse(handler, convert(xml))
  handler.to_hash
end