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.



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

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

Instance Method Details

#cloneObject



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

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

#inspectObject



1317
1318
1319
# File 'lib/rexle.rb', line 1317

def inspect()
  @value.inspect
end


1321
1322
1323
# File 'lib/rexle.rb', line 1321

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

#to_sObject



1325
1326
1327
# File 'lib/rexle.rb', line 1325

def to_s()
  @value
end

#unescapeObject



1329
1330
1331
1332
1333
# File 'lib/rexle.rb', line 1329

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