Class: Rexle::CData

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

Instance Method Summary collapse

Constructor Details

#initialize(val = '') ⇒ CData

Returns a new instance of CData.



1293
1294
1295
# File 'lib/rexle.rb', line 1293

def initialize(val='')
  @value = val
end

Instance Method Details

#cloneObject



1297
1298
1299
# File 'lib/rexle.rb', line 1297

def clone()
  CData.new(@value)
end

#inspectObject



1301
1302
1303
# File 'lib/rexle.rb', line 1301

def inspect()
  @value.inspect
end


1305
1306
1307
# File 'lib/rexle.rb', line 1305

def print()
  "<![CDATA[%s]]>" % @value
end

#to_sObject



1309
1310
1311
# File 'lib/rexle.rb', line 1309

def to_s()
  @value
end

#unescapeObject



1313
1314
1315
1316
1317
# File 'lib/rexle.rb', line 1313

def unescape()
  s = @value.clone
  %w(&lt; < &gt; > &amp; & &pos; ').each_slice(2){|x| s.gsub!(*x)}
  s
end