Class: Hpricot::DocType
- Inherits:
-
AttrNode
show all
- Includes:
- Trav, Leaf
- Defined in:
- lib/hpricot/tag.rb,
lib/hpricot/nodes.rb,
lib/hpricot/modules.rb,
lib/hpricot/modules.rb
Defined Under Namespace
Modules: Trav
Constant Summary
Constants included
from Hpricot
AttrCore, AttrEvents, AttrFocus, AttrHAlign, AttrI18n, AttrVAlign, Attrs, ElementContent, ElementExclusions, ElementInclusions, FORM_TAGS, NamedCharacters, NamedCharactersPattern, OmittedAttrName, SELF_CLOSING_TAGS
Instance Attribute Summary
Attributes inherited from AttrNode
#name, #parent, #raw_attributes
Instance Method Summary
collapse
Methods included from Leaf::Trav
#traverse_all_element, #traverse_some_element, #traverse_text_internal
Methods included from Traverse
#after, #at, #before, #bogusetag?, #children_of_type, #clean_path, #comment?, #css_path, #doc?, #doctype?, #elem?, filter, #following, #get_subnode, #html, #index, #inner_html=, #inner_text, #make, #next, #node_position, #nodes_at, #position, #preceding, #previous, #procins?, #search, #swap, #text?, #to_html, #to_original_html, #to_plain_text, #traverse_element, #traverse_text, #xmldecl?, #xpath
Methods included from Leaf
#pretty_print
Methods included from Node
#altered!, #html_quote, #if_output, #inspect_tree
Methods included from Hpricot
build, scan, uxs, xchr, xs
Constructor Details
#initialize(target, pub, sys) ⇒ DocType
Returns a new instance of DocType.
212
213
214
|
# File 'lib/hpricot/tag.rb', line 212
def initialize target, pub, sys
self.target, self.public_id, self.system_id = target, pub, sys
end
|
Instance Method Details
#clear_raw ⇒ Object
77
78
79
|
# File 'lib/hpricot/nodes.rb', line 77
def clear_raw
self.name = nil
end
|
#output(out, opts = {}) ⇒ Object
216
217
218
219
220
221
222
223
|
# File 'lib/hpricot/tag.rb', line 216
def output(out, opts = {})
out <<
if_output(opts) do
"<!DOCTYPE #{target} " +
(public_id ? "PUBLIC \"#{public_id}\"" : "SYSTEM") +
(system_id ? " #{html_quote(system_id)}" : "") + ">"
end
end
|
#pathname ⇒ Object
215
|
# File 'lib/hpricot/tag.rb', line 215
def pathname; "doctype()" end
|
#public_id ⇒ Object
82
|
# File 'lib/hpricot/nodes.rb', line 82
def public_id = (raw_attributes || {})[:public_id]
|
#public_id=(v) ⇒ Object
89
90
91
|
# File 'lib/hpricot/nodes.rb', line 89
def public_id=(v)
(self.raw_attributes ||= {})[:public_id] = v
end
|
#system_id ⇒ Object
83
|
# File 'lib/hpricot/nodes.rb', line 83
def system_id = (raw_attributes || {})[:system_id]
|
#system_id=(v) ⇒ Object
93
94
95
|
# File 'lib/hpricot/nodes.rb', line 93
def system_id=(v)
(self.raw_attributes ||= {})[:system_id] = v
end
|
#target ⇒ Object
81
|
# File 'lib/hpricot/nodes.rb', line 81
def target = (raw_attributes || {})[:target]
|
#target=(v) ⇒ Object
85
86
87
|
# File 'lib/hpricot/nodes.rb', line 85
def target=(v)
(self.raw_attributes ||= {})[:target] = v
end
|