Module: EdifactRails

Defined in:
lib/edifact_rails.rb,
lib/edifact_rails/parser.rb,
lib/edifact_rails/formats.rb,
lib/edifact_rails/version.rb,
lib/edifact_rails/exceptions.rb,
lib/edifact_rails/serializer.rb

Defined Under Namespace

Classes: Formats, Parser, Serializer, UnrecognizedFormat

Constant Summary collapse

DEFAULT_SPECIAL_CHARACTERS =
{
  component_data_element_seperator: ":",
  data_element_seperator: "+",
  decimal_notation: ".",
  escape_character: "?",
  segment_seperator: "'"
}.freeze
VERSION =
"2.1.0"

Class Method Summary collapse

Class Method Details

.parse(string) ⇒ Object



17
18
19
20
# File 'lib/edifact_rails.rb', line 17

def self.parse(string)
  parser = EdifactRails::Parser.new
  parser.parse(string)
end

.parse_file(file_path) ⇒ Object



22
23
24
# File 'lib/edifact_rails.rb', line 22

def self.parse_file(file_path)
  parse(File.read(file_path))
end

.serialize(array, with_service: true) ⇒ Object



31
32
33
34
# File 'lib/edifact_rails.rb', line 31

def self.serialize(array, with_service: true)
  serializer = EdifactRails::Serializer.new
  serializer.serialize array, with_service: with_service
end

.special_characters(string = "") ⇒ Object



26
27
28
29
# File 'lib/edifact_rails.rb', line 26

def self.special_characters(string = "")
  parser = EdifactRails::Parser.new
  parser.special_characters(string)
end