Class: HTML5::TreeBuilders::SimpleTree::Element
- Inherits:
-
Node
- Object
- Base::Node
- Node
- HTML5::TreeBuilders::SimpleTree::Element
- Defined in:
- lib/html5/treebuilders/simpletree.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Node
Attributes inherited from Base::Node
Instance Method Summary collapse
Methods inherited from Node
#appendChild, #cloneNode, #hasContent, #initialize, #insertBefore, #insertText, #removeChild
Methods inherited from Base::Node
#appendChild, #cloneNode, #hasContent, #initialize, #insertBefore, #insertText, #removeChild, #reparentChildren
Constructor Details
This class inherits a constructor from HTML5::TreeBuilders::SimpleTree::Node
Instance Method Details
#printTree(indent = 0) ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/html5/treebuilders/simpletree.rb', line 83 def printTree indent=0 tree = "\n|%s%s" % [' '* indent, self.to_s] indent += 2 for name, value in attributes tree += "\n|%s%s=\"%s\"" % [' ' * indent, name, value] end for child in childNodes tree += child.printTree(indent) end tree end |
#to_s ⇒ Object
79 80 81 |
# File 'lib/html5/treebuilders/simpletree.rb', line 79 def to_s "<#{name}>" end |