Class: Saxxy::Callbacks::Ox

Inherits:
Ox::Sax
  • Object
show all
Includes:
SAX
Defined in:
lib/saxxy/callbacks/ox.rb

Instance Method Summary collapse

Methods included from SAX

included, #on_characters, #on_end_document, #on_end_element, #on_start_element

Constructor Details

#initialize(context) ⇒ Ox


11
12
13
14
# File 'lib/saxxy/callbacks/ox.rb', line 11

def initialize(context)
  super(context)
  reset_state!
end

Instance Method Details

#attr(name, value) ⇒ Object


22
23
24
# File 'lib/saxxy/callbacks/ox.rb', line 22

def attr(name, value)
  push_attr(name, value)
end

#end_element(name) ⇒ Object


32
33
34
35
36
# File 'lib/saxxy/callbacks/ox.rb', line 32

def end_element(name)
  on_start_element_after_attr_parsing
  on_end_element(name.to_s)
  reset_state!
end

#start_element(name) ⇒ Object


16
17
18
19
20
# File 'lib/saxxy/callbacks/ox.rb', line 16

def start_element(name)
  on_start_element_after_attr_parsing
  reset_state!
  set_name(name)
end

#text(string) ⇒ Object


26
27
28
29
30
# File 'lib/saxxy/callbacks/ox.rb', line 26

def text(string)
  on_start_element_after_attr_parsing
  on_characters(string)
  unset_name
end