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.



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

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

Instance Method Details

#parse(xml) ⇒ Object



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

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