class MultiXml::Parsers::Ox::Handler
Attributes
Public Class Methods
Public Instance Methods
Source
# File lib/multi_xml/parsers/ox.rb, line 74 def append(key, value) key = key.to_s h = @stack.last if h.key?(key) v = h[key] if v.is_a?(Array) v << value else h[key] = [v, value] end else h[key] = value end end
Source
# File lib/multi_xml/parsers/ox.rb, line 47 def attr(name, value) append(name, value) unless @stack.empty? end
Source
# File lib/multi_xml/parsers/ox.rb, line 55 def cdata(value) append(MultiXml::CONTENT_ROOT, value) end
Source
# File lib/multi_xml/parsers/ox.rb, line 66 def end_element(_) @stack.pop end
Source
# File lib/multi_xml/parsers/ox.rb, line 70 def error(message, line, column) raise(Exception.new("#{message} at #{line}:#{column}")) end
Source
# File lib/multi_xml/parsers/ox.rb, line 59 def start_element(name) @stack.push({}) if @stack.empty? h = {} append(name, h) @stack.push(h) end
Source
# File lib/multi_xml/parsers/ox.rb, line 51 def text(value) append(MultiXml::CONTENT_ROOT, value) end