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.



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

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

Instance Method Details

#cloneObject



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

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

#inspectObject



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

def inspect()
  @value.inspect
end


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

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

#to_sObject



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

def to_s()
  @value
end

#unescapeObject



1334
1335
1336
1337
1338
# File 'lib/rexle.rb', line 1334

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