Class: HTML5::TreeBuilders::Hpricot::TextNode

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

Instance Attribute Summary

Attributes inherited from Node

#hpricot

Attributes inherited from Base::Node

#_flags, #childNodes, #parent

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

#initialize(data) ⇒ TextNode

Returns a new instance of TextNode.



182
183
184
# File 'lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb', line 182

def initialize(data)
  @hpricot = ::Hpricot::Text.new(data)
end

Instance Method Details

#printTree(indent = 0) ⇒ Object



186
187
188
# File 'lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb', line 186

def printTree(indent=0)
  "\n|#{' ' * indent}\"#{hpricot.content}\""
end