class REXML::Comment

Represents an XML comment; that is, text between <!– … –>
#

def <=>(other)

in the comparison.
Compares this Comment to another; the contents of the comment are used
#
def <=>(other)
  other.to_s <=> @string
end

def ==( other )

in the comparison.
Compares this Comment to another; the contents of the comment are used
#
def ==( other )
  other.kind_of? Comment and
  (other <=> self) == 0
end

def clone

def clone
  Comment.new self
end

def initialize( first, second = nil )

Parameters:
  • second () -- If the first argument is a Source, this argument
  • first () -- If String, the contents of this comment are set to the
def initialize( first, second = nil )
  super(second)
  if first.kind_of? String
    @string = first
  elsif first.kind_of? Comment
    @string = first.string
  end
end

def node_type

def node_type
  :comment
end

def write( output, indent=-1, transitive=false, ie_hack=false )

Needed for conformity to the child API, but not used by this class.
ie_hack::
Ignored by this class. The contents of comments are never modified.
transitive::
indented an additional amount.
indentation will be this number of spaces, and children will be
An integer. If -1, no indenting will be used; otherwise, the
indent::
Where to write the string
output::

See REXML::Formatters
== DEPRECATED
def write( output, indent=-1, transitive=false, ie_hack=false )
  Kernel.warn("Comment.write is deprecated.  See REXML::Formatters", uplevel: 1)
  indent( output, indent )
  output << START
  output << @string
  output << STOP
end