Class | EDI::Dir::Directory |
In: |
lib/edi4r/standards.rb
|
Parent: | Object |
A Directory object is currently a set of hashes representing all the entries for data elements, composites, segments, and messages.
As long as we employ plain CSV files to store directories, a Directory can become quite memory-consuming. Therefore Directorys are cached after creation, so that they need to be created and maintained only once when there areeseveral messages of the same type in an interchange.
Turns off this caching mechanism, saving memory but costing time.
Creates (and caches) a new directory. Returns reference to existing directory when already in cache.
std: | The syntax standard key. Currently supported:
|
params: | A hash of parameters that uniquely identify the selected dir. Hash parameters use following alternative key sets: |
ISO9735: | :d0002, :d0076 (default: "", nil) |
UN/TDID: | :d0065, :d0052, :d0054, :d0051, :d0057; :is_iedi |
SAP IDOC: | :IDOCTYPE, :SAPTYPE, :EXTENSION (see EDI_DC fields) |
UN/TDID: Elements of S009 or S320 are used:
d0065: | Message type like "INVOIC" |
d0052: | Message version number, like "90" or "D" |
d0054: | Message release number, like "1" or "03A" |
d0051: | Controlling agency, like "UN" or "EN" |
d0057: | Association assigned code (optional), like "EAN008" |
Interactive EDI (only limited supported so far):
is_iedi: | Flag, true or false. Assumed false if missing. |
Releases memory by flushing the cache. Needed primarily for unit tests, where many if not all available diagrams are created.
Returns CSV line for DE called name. If name is a Regexp, returns the first match or nil.
Iterates over each branch (message), composite, data element, or segment found (hence: BCDS) that is matched by id.
id is a string. The object type requested by this string is not obvious. This method determines it through a naming convention. See source for details.
Fails with EDI::EDILookupError when nothing found.