Class EDI::Diagram::Branch
In: lib/edi4r/diagrams.rb
Parent: Object

A Branch is a sequence of Nodes. It corresponds to a segment group without its included groups (no sub-branches). A Branch has a name (sg_name) and comes with descriptory text (desc).

Note that included TNodes may have side chains/branches ("tails").

Methods

[]   each   expand   new   shift   size   unshift  

Attributes

desc  [RW] 
sg_name  [R] 

Public Class methods

A new Branch object is uniquely identified by the key argument that selects the directory entry and its sg_name (if nto top branch). root is a reference to the Diagram it belongs to.

Public Instance methods

Access node list by index, cf. Array

Iterate through each node of the node list

Recursively add "tails" (branches, segment groups) to TNodes

Removes and returns the first node from the node list, cf. Array#shift

Returns size of the node list (number of nodes of this branch)

Makes node the first node of the node list, cf. Array#unshift

[Validate]