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.



1091
1092
1093
# File 'lib/rexle.rb', line 1091

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

Instance Method Details

#cloneObject



1095
1096
1097
# File 'lib/rexle.rb', line 1095

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

#inspectObject



1099
1100
1101
# File 'lib/rexle.rb', line 1099

def inspect()
  @value.inspect
end


1103
1104
1105
# File 'lib/rexle.rb', line 1103

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

#to_sObject



1107
1108
1109
# File 'lib/rexle.rb', line 1107

def to_s()
  @value
end

#unescapeObject



1111
1112
1113
1114
1115
# File 'lib/rexle.rb', line 1111

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