Class: Eancom::Edifact::UNS

Inherits:
Segment
  • Object
show all
Defined in:
lib/eancom/edifact/segments/uns.rb

Constant Summary collapse

TAG =
'UNS'.freeze
TYPE =
:header.freeze

Instance Attribute Summary

Attributes inherited from Segment

#tag

Instance Method Summary collapse

Methods inherited from Segment

#array, #group_name, initialize_by_components, #is_body?, #is_footer?, #is_header?, #item_group_name, #starts_item?, #starts_message?, #structure, #tag?, #to_edi, #to_hash, #to_s, #validate_structure

Constructor Details

#initialize(tag: nil, section_identification:) ⇒ UNS

Returns a new instance of UNS.



7
8
9
10
11
12
13
14
15
# File 'lib/eancom/edifact/segments/uns.rb', line 7

def initialize(
  tag: nil,
  section_identification:
)
  @tag = tag
  @section_identification = section_identification

  super(tag: tag || TAG)
end

Instance Method Details

#segment_typeObject



26
27
28
# File 'lib/eancom/edifact/segments/uns.rb', line 26

def segment_type
  TYPE
end

#to_json_hashObject



20
21
22
23
24
# File 'lib/eancom/edifact/segments/uns.rb', line 20

def to_json_hash
  hash = {}
  # hash.merge!(section_identification: find_identifier(:section_identification)) if @section_identification
  hash
end