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.



1288
1289
1290
# File 'lib/rexle.rb', line 1288

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

Instance Method Details

#cloneObject



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

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

#inspectObject



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

def inspect()
  @value.inspect
end


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

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

#to_sObject



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

def to_s()
  @value
end

#unescapeObject



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

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