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.



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

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

Instance Method Details

#cloneObject



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

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

#inspectObject



1115
1116
1117
# File 'lib/rexle.rb', line 1115

def inspect()
  @value.inspect
end


1119
1120
1121
# File 'lib/rexle.rb', line 1119

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

#to_sObject



1123
1124
1125
# File 'lib/rexle.rb', line 1123

def to_s()
  @value
end

#unescapeObject



1127
1128
1129
1130
1131
# File 'lib/rexle.rb', line 1127

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