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

#_flags, #childNodes, #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.



101
102
103
# File 'lib/html5/treebuilders/simpletree.rb', line 101

def initialize
  super nil
end

Instance Method Details

#printTree(indent = 0) ⇒ Object



105
106
107
108
109
110
111
# File 'lib/html5/treebuilders/simpletree.rb', line 105

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

#to_sObject



97
98
99
# File 'lib/html5/treebuilders/simpletree.rb', line 97

def to_s
   "#document"
end