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

This class represents a Node that can contain other Node objects. Its a base class for more specific Node types.

Methods

[]   each   first   last   new   size   store   to_rtf  

Included Modules

Enumerable

Attributes

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

Public Class methods

This is the constructor for the ContainerNode class.

Parameters

parent:A reference to the parent node that owners the new ContainerNode object.

Public Instance methods

This method overloads the array dereference operator to allow for access to the child elements of a ContainerNode object.

Parameters

index:The offset from the first child of the child object to be returned. Negative index values work from the back of the list of children. An invalid index will cause a nil value to be returned.

This method provides for iteration over the contents of a ContainerNode object.

This method fetches the first node child for a ContainerNode object. If a container contains no children this method returns nil.

This method fetches the last node child for a ContainerNode object. If a container contains no children this method returns nil.

This method returns a count of the number of children a ContainerNode object contains.

This method adds a new node element to the end of the list of nodes maintained by a ContainerNode object. Nil objects are ignored.

Parameters

node:A reference to the Node object to be added.

This method generates the RTF text for a ContainerNode object.

[Validate]