Class: Hpricot::Comment

Inherits:
BaseEle show all
Includes:
Trav, Leaf
Defined in:
lib/hpricot/tag.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, PREDEFINED, PREDEFINED_U, SELF_CLOSING_TAGS

Instance Attribute Summary

Attributes inherited from BaseEle

#parent, #raw_string

Class Method 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 Hpricot

XML, build, build_node, make, scan, uxs, xchr, xs

Methods inherited from BaseEle

alterable, #altered!, #html_quote, #if_output

Constructor Details

#initialize(content) ⇒ Comment

Returns a new instance of Comment.



218
219
220
# File 'lib/hpricot/tag.rb', line 218

def initialize(content)
  @content = content
end

Class Method Details

.parse(content) ⇒ Object



286
287
288
289
# File 'lib/hpricot/parse.rb', line 286

def Comment.parse(content)
  result = Comment.new(content)
  result
end

Instance Method Details

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



223
224
225
226
227
228
# File 'lib/hpricot/tag.rb', line 223

def output(out, opts = {})
  out <<
    if_output(opts) do
      "<!--#{@content}-->"
    end
end

#pathnameObject



221
# File 'lib/hpricot/tag.rb', line 221

def pathname; "comment()" end