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.



1343
1344
1345
# File 'lib/rexle.rb', line 1343

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

Instance Method Details

#cloneObject



1347
1348
1349
# File 'lib/rexle.rb', line 1347

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

#inspectObject



1351
1352
1353
# File 'lib/rexle.rb', line 1351

def inspect()
  @value.inspect
end


1355
1356
1357
# File 'lib/rexle.rb', line 1355

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

#to_sObject



1359
1360
1361
# File 'lib/rexle.rb', line 1359

def to_s()
  @value
end

#unescapeObject



1363
1364
1365
1366
1367
# File 'lib/rexle.rb', line 1363

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