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.



1189
1190
1191
# File 'lib/rexle.rb', line 1189

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

Instance Method Details

#cloneObject



1193
1194
1195
# File 'lib/rexle.rb', line 1193

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

#inspectObject



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

def inspect()
  @value.inspect
end


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

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

#to_sObject



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

def to_s()
  @value
end

#unescapeObject



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

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