Class: Oga::XML::Comment

Inherits:
CharacterNode show all
Defined in:
lib/oga/xml/comment.rb

Overview

Class used for storing information about XML comments.

Instance Attribute Summary

Attributes inherited from CharacterNode

#text

Attributes inherited from Node

#node_set

Instance Method Summary collapse

Methods inherited from CharacterNode

#initialize, #inspect

Methods inherited from Node

#after, #before, #children, #children=, #html?, #initialize, #next, #next_element, #parent, #previous, #previous_element, #remove, #replace, #root_node, #xml?

Methods included from Traversal

#each_node

Constructor Details

This class inherits a constructor from Oga::XML::CharacterNode

Instance Method Details

#to_xmlString

Converts the node back to XML.

Returns:

  • (String)


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

def to_xml
  "<!--#{text}-->"
end