Class EDI::Collection
In: lib/edi4r.rb
Parent: EDI::Object

An EDI collection instance behaves like a simplified array. In addition, it permits access to its elements through their names. This implies that only objects with a name may be stored, i.e. derivatives of EDI::Object.

Methods

==   []   add   append   each   find_all   first   index   inspect   last   length   names   new   root=   size  

Public Class methods

Public Instance methods

The element reference operator [] supports two access modes:

Array-like:Return indexed element when passing an integer
By name:Return array of element(s) whose name(s) match given string

Similar to Array#push(), but automatically setting obj’s parent and root to self and self’s root. Returns obj.

append( obj )

Alias for add

Delegate to array:

  index, each, find_all, length, size, first, last

This implementation of +inspect()+ is very verbose in that it inspects also all contained objects in a recursive manner.

indent:String offset to use for indentation / pretty-printing
symlist:Array of getter names (passed as symbols) whose values are to be listed. Note that :name is included automatically.

Returns an array of names of all included objects in proper sequence; primarily for internal use.

[Validate]