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.



1274
1275
1276
# File 'lib/rexle.rb', line 1274

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

Instance Method Details

#cloneObject



1278
1279
1280
# File 'lib/rexle.rb', line 1278

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

#inspectObject



1282
1283
1284
# File 'lib/rexle.rb', line 1282

def inspect()
  @value.inspect
end


1286
1287
1288
# File 'lib/rexle.rb', line 1286

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

#to_sObject



1290
1291
1292
# File 'lib/rexle.rb', line 1290

def to_s()
  @value
end

#unescapeObject



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

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