tag = 'UNZ' Eancom.register_segment(tag: tag, klass: Eancom::Edifact::UNZ) structure = Eancom::Edifact::Structure.new(tag: tag) #============================================================================== # Tag # #============================================================================== tag = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, length: 3, dictionary: nil, description: "Message Header", required: true ) tag.add(:tag, data) structure << tag #============================================================================== # Interchange control count # #============================================================================== interchange_control_count = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, length: 1..6, dictionary: nil, description: "Interchange control count", required: true ) interchange_control_count.add(:interchange_control_count, data) structure << interchange_control_count #============================================================================== # Interchange control reference # #============================================================================== interchange_control_reference = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, length: 1..14, dictionary: nil, description: "Number of segments in the message", required: true ) interchange_control_reference.add(:interchange_control_reference, data) structure << interchange_control_reference #============================================================================== Eancom.register_structure(tag: 'UNZ', structure: structure)