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.



1197
1198
1199
# File 'lib/rexle.rb', line 1197

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

Instance Method Details

#cloneObject



1201
1202
1203
# File 'lib/rexle.rb', line 1201

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

#inspectObject



1205
1206
1207
# File 'lib/rexle.rb', line 1205

def inspect()
  @value.inspect
end


1209
1210
1211
# File 'lib/rexle.rb', line 1209

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

#to_sObject



1213
1214
1215
# File 'lib/rexle.rb', line 1213

def to_s()
  @value
end

#unescapeObject



1217
1218
1219
1220
1221
# File 'lib/rexle.rb', line 1217

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