Class: Nokogiri::XML::AfterHandler

Inherits:
BeforeHandler show all
Defined in:
lib/nokogiri/xml/after_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BeforeHandler

#characters, #start_element

Methods inherited from SAX::Document

#cdata_block, #characters, #comment, #end_document, #error, #start_document, #start_element, #warning

Constructor Details

#initialize(node, original_html) ⇒ AfterHandler

Returns a new instance of AfterHandler.



6
7
8
9
# File 'lib/nokogiri/xml/after_handler.rb', line 6

def initialize node, original_html
  super
  @after_nodes = []
end

Instance Attribute Details

#after_nodesObject

Returns the value of attribute after_nodes.



4
5
6
# File 'lib/nokogiri/xml/after_handler.rb', line 4

def after_nodes
  @after_nodes
end

Instance Method Details

#end_element(name) ⇒ Object



11
12
13
14
15
# File 'lib/nokogiri/xml/after_handler.rb', line 11

def end_element name
  return unless @original_html =~ /<#{name}/i
  @after_nodes << @stack.last if @stack.length == 1
  @stack.pop
end