Class RTF::TextNode
In: lib/rtf/node.rb
Parent: Node

This class represents a specialisation of the Node class to refer to a Node that simply contains text.


append   insert   new   to_rtf  


text  [R]  Attribute accessor.
text  [W]  Attribute mutator.

Public Class methods

This is the constructor for the TextNode class.


parent:A reference to the Node that owns the TextNode. Must not be nil.
text:A String containing the node text. Defaults to nil.


RTFError:Generated whenever an nil parent object is specified to the method.

Public Instance methods

This method concatenates a String on to the end of the existing text within a TextNode object.


text:The String to be added to the end of the text node.

This method inserts a String into the existing text within a TextNode object. If the TextNode contains no text then it is simply set to the text passed in. If the offset specified is past the end of the nodes text then it is simply appended to the end.


text:A String containing the text to be added.
offset:The numbers of characters from the first character to insert the new text at.

This method generates the RTF equivalent for a TextNode object. This method escapes any special sequences that appear in the text.