class REXML::Element
def text=( text )
d.root.text = nil #-> '
With argument +nil+, removes the first text child:
d.root.text = 'bar' #-> 'bar'
If the element has a text child, it is replaced:
d.root.text = 'foo' #-> 'foo'
d = REXML::Document.new ''
If the element has no text child, the text node is added:
returns +string+.
then places the node as the first text child in the element;
honoring the current settings for whitespace and row,
creates a new \REXML::Text node containing that string,
With string argument +string+,
Adds, replaces, or removes the first text node child in the element.
text = nil -> nil
text = string -> string
:call-seq:
def text=( text ) if text.kind_of? String text = Text.new( text, whitespace(), nil, raw() ) elsif !text.nil? and !text.kind_of? Text text = Text.new( text.to_s, whitespace(), nil, raw() ) end old_text = get_text if text.nil? old_text.remove unless old_text.nil? else if old_text.nil? self << text else old_text.replace_with( text ) end end return self end