tag = 'UNS' Eancom.register_segment(tag: tag, klass: Eancom::Edifact::UNS) structure = Eancom::Edifact::Structure.new(tag: tag) #============================================================================== # Tag # #============================================================================== tag = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, length: 1..3, dictionary: nil, description: "Message Header", required: true ) tag.add(:tag, data) structure << tag #============================================================================== # Section identification #============================================================================== section_identification = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, length: 0..1, dictionary: { 'S' => { description: 'Detail/summary section separation', identifier: 'detail_summary_section_separation' } }, description: "Section identification", required: true ) section_identification.add(:section_identification, data) structure << section_identification #============================================================================== Eancom.register_structure(tag: 'UNS', structure: structure)