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.



1166
1167
1168
# File 'lib/rexle.rb', line 1166

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

Instance Method Details

#cloneObject



1170
1171
1172
# File 'lib/rexle.rb', line 1170

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

#inspectObject



1174
1175
1176
# File 'lib/rexle.rb', line 1174

def inspect()
  @value.inspect
end


1178
1179
1180
# File 'lib/rexle.rb', line 1178

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

#to_sObject



1182
1183
1184
# File 'lib/rexle.rb', line 1182

def to_s()
  @value
end

#unescapeObject



1186
1187
1188
1189
1190
# File 'lib/rexle.rb', line 1186

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