Class: HTML5::TreeBuilders::SimpleTree::Document

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

Instance Attribute Summary

Attributes inherited from Node

#attributes, #name, #value

Attributes inherited from Base::Node

#childNodes, #flags, #parent

Instance Method Summary collapse

Methods inherited from Node

#appendChild, #cloneNode, #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.



107
108
109
# File 'lib/html5/treebuilders/simpletree.rb', line 107

def initialize
  super nil
end

Instance Method Details

#printTree(indent = 0) ⇒ Object



111
112
113
114
115
116
117
# File 'lib/html5/treebuilders/simpletree.rb', line 111

def printTree indent=0
  tree = to_s
  for child in childNodes
    tree += child.printTree(indent + 2)
  end
  tree
end

#to_sObject



103
104
105
# File 'lib/html5/treebuilders/simpletree.rb', line 103

def to_s
   "#document"
end