class XML::DOM::Comment
Class XML::DOM::Comment
¶ ↑
superclass¶ ↑
Class XML::DOM::Comment
¶ ↑
superclass¶ ↑
Public Class Methods
Source
# File lib/xml/dom/core.rb, line 2588 def initialize(text = nil) super(text) raise "parameter error" if !text end
Class Methods¶ ↑
Calls superclass method
XML::DOM::CharacterData::new
Public Instance Methods
Source
# File lib/xml/dom/core.rb, line 2638 def _getMyLocation(parent) index = 1 parent.childNodes do |child| if child == self return "child(#{index},#comment)" end if child.nodeType == COMMENT_NODE index += 1 end end nil end
Source
# File lib/xml/dom2/xpath.rb, line 364 def _getMyLocationInXPath(parent) n = parent.childNodes.to_a.select { |i| i.nodeType == COMMENT_NODE }.index(self) "comment()[#{n + 1}]" end
Source
# File lib/xml/dom/core.rb, line 2633 def dump(depth = 0) print ' ' * depth * 2 print "<!--#{@value.inspect}-->\n" end
Source
# File lib/xml/dom/core.rb, line 2622 def to_s ret = "<!--#{@value}-->" ret << "\n" if parentNode.nodeType == DOCUMENT_NODE ret end