Class: HTML5::TreeBuilders::Hpricot::Document

Inherits:
Node show all
Defined in:
lib/html5/treebuilders/hpricot.rb

Instance Attribute Summary

Attributes inherited from Node

#hpricot

Attributes inherited from Base::Node

#childNodes, #flags, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#appendChild, #hasContent, #insertBefore, #insertText, #removeChild

Methods inherited from Base::Node

#appendChild, #cloneNode, #hasContent, #insertBefore, #insertText, #removeChild, #reparentChildren

Constructor Details

#initializeDocument

Returns a new instance of Document.



140
141
142
# File 'lib/html5/treebuilders/hpricot.rb', line 140

def initialize
  super(nil)
end

Class Method Details

.hpricot_classObject



136
137
138
# File 'lib/html5/treebuilders/hpricot.rb', line 136

def self.hpricot_class
  ::Hpricot::Doc
end

Instance Method Details

#printTree(indent = 0) ⇒ Object



144
145
146
# File 'lib/html5/treebuilders/hpricot.rb', line 144

def printTree(indent=0)
  childNodes.inject('#document') { |tree, child| tree + child.printTree(indent + 2) }
end