Class: Hpricot::DocType

Inherits:
Object show all
Includes:
Trav, Leaf
Defined in:
lib/ext/hpricot/tag.rb,
lib/ext/hpricot/modules.rb,
lib/ext/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 collapse

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!, #clear_raw, #html_quote, #if_output, #inspect_tree

Methods included from Hpricot

XML, build, make, parse, uxs, xchr, xs

Constructor Details

#initialize(target, pub, sys) ⇒ DocType

Returns a new instance of DocType.



163
164
165
# File 'lib/ext/hpricot/tag.rb', line 163

def initialize target, pub, sys
  self.target, self.public_id, self.system_id = target, pub, sys
end

Instance Attribute Details

#public_idObject

Returns the value of attribute public_id.



162
163
164
# File 'lib/ext/hpricot/tag.rb', line 162

def public_id
  @public_id
end

#system_idObject

Returns the value of attribute system_id.



162
163
164
# File 'lib/ext/hpricot/tag.rb', line 162

def system_id
  @system_id
end

#targetObject

Returns the value of attribute target.



162
163
164
# File 'lib/ext/hpricot/tag.rb', line 162

def target
  @target
end

Instance Method Details

#output(out, opts = {}) ⇒ Object



167
168
169
170
171
172
173
174
# File 'lib/ext/hpricot/tag.rb', line 167

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

#pathnameObject



166
# File 'lib/ext/hpricot/tag.rb', line 166

def pathname; "doctype()" end