class REXML::Comment
クラスの継承リスト: REXML::Comment < Comparable < REXML::Child < REXML::Node < Object < Kernel < BasicObject
要約
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 "
目次
特異メソッド
new(string, parent = nil) -> REXML::Commentnew(comment, parent = nil) -> REXML::Comment-
Comment オブジェクトを生成します。
引数に REXML::Comment オブジェクトを渡すとその内容が複製されます (親ノードの情報は複製されません)。
- [PARAM] string:
- コメント文字列
- [PARAM] comment:
- REXML::Comment オブジェクト
- [PARAM] parent:
- 親ノード
インスタンスメソッド
self <=> other -> -1 | 0 | 1-
other と内容(REXML::Comment#string)を比較します。
self == other -> bool-
other と内容(REXML::Comment#string)が同じならば真を返します。
clone -> REXML::Comment-
内容が複製された Commnent オブジェクトを返します。 (親ノードの情報は複製されません)。
node_type -> Symbol-
シンボル :comment を返します。
string -> Stringto_s -> String-
コメント文字列を返します。
string=(value)-
コメント文字列を設定します。
- [PARAM] value:
- 設定する文字列
class REXML::Comment