要約
XML コメントを表すクラス。
コメントとは <!-- と --> で挟まれたテキストです。
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<!-- xx -->
<root>
<!-- yy -->
text
<!-- zz -->
</root>
EOS
doc[0].string # => " xx "
doc.root[1].string # => " yy "
doc.root[3].string # => " zz "
目次
継承しているメソッド
- Comparableから継承しているメソッド
- REXML::Childから継承しているメソッド
- REXML::Nodeから継承しているメソッド
特異メソッド
- new(string, parent = nil) -> REXML::Comment[permalink][rdoc][edit]
- new(comment, parent = nil) -> REXML::Comment
- 
Comment オブジェクトを生成します。 引数に REXML::Comment オブジェクトを渡すとその内容が複製されます (親ノードの情報は複製されません)。 - [PARAM] string:
- コメント文字列
- [PARAM] comment:
- REXML::Comment オブジェクト
- [PARAM] parent:
- 親ノード
 
インスタンスメソッド
- self <=> other -> -1 | 0 | 1[permalink][rdoc][edit]
- 
other と内容(REXML::Comment#string)を比較します。 
- self == other -> bool[permalink][rdoc][edit]
- 
other と内容(REXML::Comment#string)が同じならば真を返します。 
- clone -> REXML::Comment[permalink][rdoc][edit]
- 
内容が複製された Comment オブジェクトを返します。 (親ノードの情報は複製されません)。 
- node_type -> Symbol[permalink][rdoc][edit]
- 
シンボル :comment を返します。 
- string -> String[permalink][rdoc][edit]
- to_s -> String
- 
コメント文字列を返します。 
- string=(value)[permalink][rdoc][edit]
- 
コメント文字列を設定します。 - [PARAM] value:
- 設定する文字列