Class: NXML::CDATA

Inherits:
Object
  • Object
show all
Defined in:
lib/nxml.rb

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ CDATA

Returns a new instance of CDATA.



142
143
144
145
146
147
148
# File 'lib/nxml.rb', line 142

def initialize(data)
  if not data.index(']]>').nil?
    raise ArgumentError.new "CDATA should not contain CDATA closing sequence ']]>'"
  end

  @data = data
end

Instance Method Details

#to_strObject



150
151
152
# File 'lib/nxml.rb', line 150

def to_str
  "<![CDATA[#{@data}]]>"
end