Class: HTML5::TreeBuilders::REXML::TextNode
- Inherits:
-
Node
- Object
- Base::Node
- Node
- HTML5::TreeBuilders::REXML::TextNode
- Defined in:
- lib/html5/treebuilders/rexml.rb
Instance Attribute Summary
Attributes inherited from Node
Attributes inherited from Base::Node
Instance Method Summary collapse
-
#initialize(data) ⇒ TextNode
constructor
A new instance of TextNode.
- #printTree(indent = 0) ⇒ Object
Methods inherited from Node
#appendChild, #hasContent, #insertBefore, #insertText, #removeChild
Methods inherited from Base::Node
#appendChild, #cloneNode, #hasContent, #insertBefore, #insertText, #removeChild, #reparentChildren
Constructor Details
#initialize(data) ⇒ TextNode
Returns a new instance of TextNode.
159 160 161 162 |
# File 'lib/html5/treebuilders/rexml.rb', line 159 def initialize data raw = data.gsub('&', '&').gsub('<', '<').gsub('>', '>') @rxobj = ::REXML::Text.new(raw, true, nil, true) end |
Instance Method Details
#printTree(indent = 0) ⇒ Object
164 165 166 |
# File 'lib/html5/treebuilders/rexml.rb', line 164 def printTree indent=0 "\n|#{' ' * indent}\"#{rxobj.value}\"" end |