class XML::DOM::CharacterData
Class XML::DOM::CharacterData
¶ ↑
superclass¶ ↑
Class XML::DOM::CharacterData
¶ ↑
superclass¶ ↑
Public Class Methods
new(text = nil)
click to toggle source
Class Methods¶ ↑
Calls superclass method
XML::DOM::Node::new
# File lib/xml/dom/core.rb, line 2295 def initialize(text = nil) super() raise "parameter error" if !text @value = text end
Public Instance Methods
appendData(str)
click to toggle source
# File lib/xml/dom/core.rb, line 2359 def appendData(str) @value << str end
cloneNode(deep = true)
click to toggle source
Calls superclass method
XML::DOM::Node#cloneNode
# File lib/xml/dom/core.rb, line 2413 def cloneNode(deep = true) super(deep, @value.dup) end
data()
click to toggle source
data=(p)
click to toggle source
# File lib/xml/dom/core.rb, line 2321 def data=(p) @value = p end
deleteData(offset, count)
click to toggle source
# File lib/xml/dom/core.rb, line 2384 def deleteData(offset, count) if offset < 0 || offset > @value.length || count < 0 raise DOMException.new(DOMException::INDEX_SIZE_ERR) end @value[offset, count] = '' end
insertData(offset, str)
click to toggle source
# File lib/xml/dom/core.rb, line 2370 def insertData(offset, str) if offset < 0 || offset > @value.length raise DOMException.new(DOMException::INDEX_SIZE_ERR) end @value[offset, 0] = str end
length()
click to toggle source
# File lib/xml/dom/core.rb, line 2332 def length @value.length end
nodeValue()
click to toggle source
# File lib/xml/dom/core.rb, line 2425 def nodeValue @value end
nodeValue=(p)
click to toggle source
# File lib/xml/dom/core.rb, line 2436 def nodeValue=(p) @value = p end
replaceData(offset, count, str)
click to toggle source
# File lib/xml/dom/core.rb, line 2399 def replaceData(offset, count, str) if offset < 0 || offset > @value.length || count < 0 raise DOMException.new(DOMException::INDEX_SIZE_ERR) end @value[offset, count] = str end
substringData(start, count)
click to toggle source
# File lib/xml/dom/core.rb, line 2343 def substringData(start, count) if start < 0 || start > @value.length || count < 0 raise DOMException.new(DOMException::INDEX_SIZE_ERR) end ## if the sum of start and count > length, ## return all characters to the end of the value. @value[start, count] end