Class: Eancom::Edifact::RFF

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

Constant Summary collapse

TAG =
'RFF'.freeze
TYPE =
:body.freeze

Instance Attribute Summary

Attributes inherited from Segment

#tag

Instance Method Summary collapse

Methods inherited from Segment

#array, 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, reference_code_qualifier:, reference_identifier: nil, document_line_identifier: nil) ⇒ RFF

Returns a new instance of RFF.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/eancom/edifact/segments/rff.rb', line 7

def initialize(
  tag: nil,
  reference_code_qualifier:,
  reference_identifier: nil,
  document_line_identifier: nil
  )
  @tag = tag
  @reference_code_qualifier = reference_code_qualifier
  @reference_identifier = reference_identifier
  @document_line_identifier = document_line_identifier

  super(tag: @tag || TAG)
end

Instance Method Details

#group_nameObject



31
32
33
# File 'lib/eancom/edifact/segments/rff.rb', line 31

def group_name
  'references'
end

#segment_typeObject



35
36
37
# File 'lib/eancom/edifact/segments/rff.rb', line 35

def segment_type
  TYPE
end

#to_json_hashObject



21
22
23
24
25
26
27
28
29
# File 'lib/eancom/edifact/segments/rff.rb', line 21

def to_json_hash
  {
    identifier => {
      reference_identifier: @reference_identifier,
      document_line_identifier: @document_line_identifier
    },
    identifier: @identifier
  }
end