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.



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

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

Instance Method Details

#cloneObject



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

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

#inspectObject



1306
1307
1308
# File 'lib/rexle.rb', line 1306

def inspect()
  @value.inspect
end


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

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

#to_sObject



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

def to_s()
  @value
end

#unescapeObject



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

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