| Class | EDI::E::Interchange |
| In: |
lib/edi4r/edifact.rb
lib/edi4r/edifact-rexml.rb |
| Parent: | EDI::Interchange |
Interchange: Class of the top-level objects of UN/EDIFACT data
| charset | [R] | |
| groups_created | [R] | |
| messages_created | [R] | |
| show_una | [RW] | |
| una | [R] |
Create an empty UN/EDIFACT interchange
| :charset : | Sets S001.0001, default = ‘UNOB‘ |
| :version : | Sets S001.0002, default = 3 |
| :i_edi : | Interactive EDI mode, a boolean (UIB instead of UNB …), default = false |
| :show_una : | Adds UNA sement to output, default = true |
| :output_mode : | See setter output_mode=(), default = :verbatim |
| :una_string : | See class UNA for setters, default = nil |
| :sender : | Presets DE S002/0004, default = nil |
| :recipient : | Presets DE S003/0010, default = nil |
| :interchange_control_reference : | Presets DE 0020, default = ‘1’ |
| :application_reference : | Presets DE 0026, default = nil |
| :interchange_agreement_id : | Presets DE 0032, default = nil |
| :acknowledgment_request : | Presets DE 0031, default = nil |
| :test_indicator : | Presets DE 0035, default = nil |
Reads EDIFACT data from given stream (default: $stdin), parses it and returns an Interchange object
Returns a REXML document that represents the interchange
| xdoc: | REXML document that contains the XML representation of a UN/EDIFACT interchange |
Read maxlen bytes from $stdin (default) or from given stream (UN/EDIFACT data expected), and peek into first segment (UNB/UIB).
Returns an empty Interchange object with a properly header filled.
Intended use:
Efficient routing by reading just UNB data: sender/recipient/ref/test
Read maxlen bytes from $stdin (default) or from given stream (UN/EDIFACT data expected), and peek into first segment (UNB/UIB).
Returns an empty Interchange object with a properly header filled.
Intended use:
Efficient routing by reading just UNB data: sender/recipient/ref/test
Yields a readable, properly indented list of all contained objects, including the empty ones. This may be a very long string!
Derive an empty message from this interchange context. Parameters may be passed hash-like. See Message.new for details
Derive an empty message group from this interchange context. Parameters may be passed hash-like. See MsgGroup.new for details
This method modifies the behaviour of method to_s(): UN/EDIFACT interchanges and their components are turned into strings either "verbatim" (default) or in some more readable way. This method corresponds to a parameter with same name at creation time.
Valid values:
| :linebreak : | One-segment-per-line representation |
| :indented : | Like :linebreak but with additional indentation (2 blanks per hierarchy level). |
| :verbatim : | No linebreak (default), ISO compliant |
Returns the string representation of the interchange.
Type conversion and escaping are provided. The UNA object is shown when show_una is set to true . See output_mode for modifiers.