Class: Makiri::Comment

Inherits:
Node
  • Object
show all
Defined in:
lib/makiri/comment.rb,
ext/makiri/makiri.c

Direct Known Subclasses

HTML::Comment, XML::Comment

Class Method Summary collapse

Methods inherited from Node

#add_class, #append_class, #at, #attribute, #attribute?, #attributes, #blank?, #cdata?, #classes, #clone, #comment?, #document?, #document_fragment?, #dup, #each, #element?, #inspect, #path, #processing_instruction?, #remove_class, #root, #search, #set_attribute, #text?, #to_h, #traverse

Class Method Details

.new(document, content) ⇒ Makiri::Comment

Create a detached comment owned by document (Nokogiri-style constructor; the document comes FIRST for Comment / CDATASection / ProcessingInstruction, unlike Element / Text). Delegates to Document#create_comment.

Parameters:

Returns:



12
13
14
# File 'lib/makiri/comment.rb', line 12

def self.new(document, content)
  Makiri::Document.coerce!(document).create_comment(content)
end