Sha256: bcee45c942f4f3f739f5ec91ce5670925fa2a7da31985013b23beb06ee85abcc

Contents?: true

Size: 1.07 KB

Versions: 10

Compression:

Stored size: 1.07 KB

Contents

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

      def initialize(
        tag: nil,
        line_item_identifier_1:,
        action_request_notification_description_code: '',
        item_identifier:,
        item_type_identification_code:,
        sub_line_indicator_code: nil,
        line_item_identifier_2: nil
      )
        @tag = tag
        @line_item_identifier_1 = line_item_identifier_1
        @action_request_notification_description_code = action_request_notification_description_code
        @item_identifier = item_identifier
        @item_type_identification_code = item_type_identification_code
        @sub_line_indicator_code = sub_line_indicator_code
        @line_item_identifier_2 = line_item_identifier_2

        super(tag: tag || TAG )
      end

      def starts_item?
        true
      end

      def to_json_hash
        {
          line_item_identifier_1: @line_item_identifier_1,
          ean: @item_identifier
        }
      end

      def segment_type
        TYPE
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
eancom-1.6.3 lib/eancom/edifact/segments/lin.rb
eancom-1.6.2 lib/eancom/edifact/segments/lin.rb
eancom-1.6.0 lib/eancom/edifact/segments/lin.rb
eancom-1.5.7 lib/eancom/edifact/segments/lin.rb
eancom-1.5.6 lib/eancom/edifact/segments/lin.rb
eancom-1.5.5 lib/eancom/edifact/segments/lin.rb
eancom-1.5.4 lib/eancom/edifact/segments/lin.rb
eancom-1.5.2 lib/eancom/edifact/segments/lin.rb
eancom-1.5.1 lib/eancom/edifact/segments/lin.rb
eancom-1.5.0 lib/eancom/edifact/segments/lin.rb