Sha256: 6dc2bedee8b0ca27c2eb63e5d799702092f0cd047ba2b0ce1cccf5533cd9ac91

Contents?: true

Size: 880 Bytes

Versions: 15

Compression:

Stored size: 880 Bytes

Contents

module Eancom
  module Edifact
    class RFF < Segment
      TAG = 'RFF'.freeze
      TYPE = :body.freeze

      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

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

      def segment_type
        TYPE
      end

      private

      def identifier
        @identifier ||= structure.find(:reference_code_qualifier).dictionary[@reference_code_qualifier][:identifier]
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
eancom-1.6.3 lib/eancom/edifact/segments/rff.rb
eancom-1.6.2 lib/eancom/edifact/segments/rff.rb
eancom-1.6.0 lib/eancom/edifact/segments/rff.rb
eancom-1.5.7 lib/eancom/edifact/segments/rff.rb
eancom-1.5.6 lib/eancom/edifact/segments/rff.rb
eancom-1.5.5 lib/eancom/edifact/segments/rff.rb
eancom-1.5.4 lib/eancom/edifact/segments/rff.rb
eancom-1.5.2 lib/eancom/edifact/segments/rff.rb
eancom-1.5.1 lib/eancom/edifact/segments/rff.rb
eancom-1.5.0 lib/eancom/edifact/segments/rff.rb
eancom-1.4.0 lib/eancom/edifact/segments/rff.rb
eancom-1.3.0 lib/eancom/edifact/segments/rff.rb
eancom-1.2.0 lib/eancom/edifact/segments/rff.rb
eancom-1.1.1 lib/eancom/edifact/segments/rff.rb
eancom-1.1.0 lib/eancom/edifact/segments/rff.rb