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.



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

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

Instance Method Details

#cloneObject



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

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

#inspectObject



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

def inspect()
  @value.inspect
end


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

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

#to_sObject



1328
1329
1330
# File 'lib/rexle.rb', line 1328

def to_s()
  @value
end

#unescapeObject



1332
1333
1334
1335
1336
# File 'lib/rexle.rb', line 1332

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