Class: HTML5::TreeBuilders::Hpricot::DocumentType
- Inherits:
-
Node
- Object
- Base::Node
- Node
- HTML5::TreeBuilders::Hpricot::DocumentType
- Defined in:
- lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb
Instance Attribute Summary
Attributes inherited from Node
Attributes inherited from Base::Node
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, public_id, system_id) ⇒ DocumentType
constructor
A new instance of DocumentType.
- #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(name, public_id, system_id) ⇒ DocumentType
Returns a new instance of DocumentType.
153 154 155 156 157 158 159 160 |
# File 'lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb', line 153 def initialize(name, public_id, system_id) begin super(name) rescue ArgumentError # needs 3... end @hpricot = ::Hpricot::DocType.new(name, public_id, system_id) end |
Class Method Details
.hpricot_class ⇒ Object
149 150 151 |
# File 'lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb', line 149 def self.hpricot_class ::Hpricot::DocType end |
Instance Method Details
#printTree(indent = 0) ⇒ Object
162 163 164 165 166 167 168 |
# File 'lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb', line 162 def printTree(indent=0) if hpricot.target and hpricot.target.any? "\n|#{' ' * indent}<!DOCTYPE #{hpricot.target}>" else "\n|#{' ' * indent}<!DOCTYPE >" end end |