Module: SAXMachine

Overview

Monkeypatch SAXMachine to keep the raw XMK

Ugly but fun, isn’t it? This may blow up at some point

Instance Method Summary collapse

Instance Method Details

#old_parseObject



18
# File 'lib/webee.rb', line 18

alias_method :old_parse, :parse

#parse(xml, on_error = nil, on_warning = nil) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/webee.rb', line 20

def parse(xml, on_error = nil, on_warning = nil)
  obj = old_parse(xml, on_error, on_warning)
  obj.instance_variable_set :@raw, xml
  obj.class.send :define_method, 'raw' do
    @raw
  end
  obj
end