Class: NXML::CDATA
- Inherits:
-
Object
- Object
- NXML::CDATA
- Defined in:
- lib/nxml.rb
Instance Method Summary collapse
-
#initialize(data) ⇒ CDATA
constructor
A new instance of CDATA.
- #to_str ⇒ Object
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_str ⇒ Object
150 151 152 |
# File 'lib/nxml.rb', line 150 def to_str "<![CDATA[#{@data}]]>" end |