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.



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

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

Instance Method Details

#cloneObject



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

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

#inspectObject



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

def inspect()
  @value.inspect
end


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

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

#to_sObject



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

def to_s()
  @value
end

#unescapeObject



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

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