Class EDI::Interchange
In: lib/edi4r.rb
lib/edi4r/rexml.rb
Parent: Collection_HT

Base class of all interchanges

Methods

add   new   parse   parse_xml   peek   to_xml  

Attributes

illegal_charset_pattern  [R] 
output_mode  [R] 
output_mode  [RW] 
syntax  [R] 
version  [R] 

Public Class methods

Abstract class - don’t instantiate directly

Auto-detect file content, optionally decompress, return an Interchange object of the sub-class that matches the (unzipped) content.

This is a convenience method. When you know the file contents, consider a direct call to Interchange::E::parse etc.

NOTES:

  • Make sure to require ‘zlib’ when applying this method to gzipped files.
  • BZIP2 is indirectly supported by calling "bzcat". Make sure that "bzcat" is available when applying this method to *.bz2 files.
  • Do not pass $stdin to this method - we could not "rewind" it!

This is a dispatcher method for your convenience, similar to EDI::Interchange.parse. It may be used for all supported EDI standards.

hnd:A REXML document or something that can be turned into one, i.e. an IO object or a String object with corresponding contents

Returns an Interchange object of the subclass specified by the "standard_key" atribute of the root element, e.g. a EDI::E::Interchange.

Auto-detect file content, optionally decompress, return an empty Interchange object of that sub-class with only the header filled.

This is a convenience method. When you know the file contents, consider a direct call to Interchange::E::peek etc.

NOTES: See Interchange.parse

Public Instance methods

Add either Message objects or MsgGroup objects to an interchange; mixing both types raises a TypeError.

[Validate]