Sha256: 9d45ad91ba8a11fccc5489c342e8aba45df6efbfc963bd71c6a6d8ad0b3257fc

Contents?: true

Size: 1.01 KB

Versions: 15

Compression:

Stored size: 1.01 KB

Contents

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

      attr_reader :segment_type

      def initialize(
        tag: nil,
        document_name_code: nil,
        code_list_responsible_agency_code: nil,
        code_list_identification_code: nil,
        document_name: nil,
        document_identifier: nil,
        message_function_code: nil
      )
        @tag = tag
        @document_name_code = document_name_code
        @code_list_responsible_agency_code = code_list_responsible_agency_code
        @code_list_identification_code = code_list_identification_code
        @document_name = document_name
        @document_identifier = document_identifier
        @message_function_code = message_function_code

        super(tag: tag || TAG)
      end

      def to_json_hash
        {
          document_identifier: @document_identifier
        }
      end

      def starts_message?
        true
      end

      def segment_type
        TYPE
      end

    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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