Socket
Book a DemoInstallSign in
Socket

edi4r

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edi4r

0.9.6.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

= EDI TOOLKIT for RUBY (edi4r)

This is Ruby gem edi4r version :include:VERSION

Edi4r was created to greatly simplify the creation and processing of data for Electronic Data Interchange (EDI). In particular, it supports the UN/EDIFACT syntax (ISO 9573) and optionally SAP IDocs. Limited support is offered for ANSI X.12 and SEDAS.

== Installation

Install it as any other Ruby gem, e.g.:

sudo gem install edi4r-.gem

With administrator privileges and network access, just type:

gem install edi4r

== Usage

require 'edi4r' # Older installations: require_gem 'edi4r' require 'edi4r/edifact' # optional

Build a UN/EDIFACT interchange from its character representation in a file:

ic = nil File.open("received.edi") {|hnd| ic = EDI::E::Interchange.parse( hnd ) } ic.each do |msg| # Process message, here: Just list document numbers from (only) segment BGM puts msg['BGM'].first.d1004 end

Create a minimalistic interchange

ic = EDI::E::Interchange.new # Default: syntax version=3, charset = UNOB msg = ic.new_message # Default: ORDERS D.96A

bgm = msg.new_segment('BGM') # Obtain an empty segment bgm.cC002.d1001 = '220' # Add some content to mandatory elements bgm.d1004 = 'PO-54321' dtm = msg.new_segment('DTM') dtm.cC507.d2005 = '137' uns = msg.new_segment('UNS') uns.d0081 = 'S' [bgm, dtm, uns].each {|seg| msg.add seg} # Add segments to message ic.add msg # Add message to interchange - ready to go!

ic.header.cS002.d0004 = 'sender'; ic.header.cS003.d0010 = 'recipient' # UNB ic.validate # Conforming to standard? print ic # Could be sent that way!

== See also

  • Background[link:EDI.html] info about data structure and classes.

  • A Tutorial[link:Tutorial.html] for examples of use.

  • A Changelog[link:Changelog.html] is maintained since version 0.8

  • Finally, see TO-DO[link:TO-DO.html] for the current wish list.

  • This code is put under the Ruby license, see COPYING[link:COPYING.html] for details.

:include:AuthorCopyright

Enjoy,

Heinz

FAQs

Package last updated on 31 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.