Class: Nokogiri::XML::AfterHandler
- Inherits:
-
BeforeHandler
- Object
- SAX::Document
- BeforeHandler
- Nokogiri::XML::AfterHandler
- Defined in:
- lib/nokogiri/xml/after_handler.rb
Instance Attribute Summary collapse
-
#after_nodes ⇒ Object
Returns the value of attribute after_nodes.
Instance Method Summary collapse
- #end_element(name) ⇒ Object
-
#initialize(node, original_html) ⇒ AfterHandler
constructor
A new instance of AfterHandler.
Methods inherited from BeforeHandler
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_nodes ⇒ Object
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 |