Sha256: e20d1e0af65734d27d0cd67c45b8ccb83799df25099292c10e4d642a008882f3

Contents?: true

Size: 1.28 KB

Versions: 4

Compression:

Stored size: 1.28 KB

Contents

module Eancom
  module Edifact
    class UNH < Segment
      TAG = 'UNH'.freeze
      TYPE = :header.freeze

      def initialize(
        tag: nil,
        message_reference_number:,
        message_type:,
        message_version_number:,
        message_release_number:,
        controlling_agency:,
        association_assigned_code:,
        code_list_directory_version_number: nil
      )

        @tag = tag
        @message_reference_number = message_reference_number
        @message_type = message_type
        @message_version_number = message_version_number
        @message_release_number = message_release_number
        @controlling_agency = controlling_agency
        @association_assigned_code = association_assigned_code
        @code_list_directory_version_number = code_list_directory_version_number
        super(tag: tag || TAG)
      end

      def to_json_hash
        {
          message_reference_number: @message_reference_number,
          message_type: @message_type,
          message_version_number: @message_version_number,
          message_release_number: @message_release_number,
          controlling_agency: @controlling_agency,
          association_assigned_code: @association_assigned_code
        }
      end

      def segment_type
        TYPE
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
eancom-1.3.0 lib/eancom/edifact/segments/unh.rb
eancom-1.2.0 lib/eancom/edifact/segments/unh.rb
eancom-1.1.1 lib/eancom/edifact/segments/unh.rb
eancom-1.1.0 lib/eancom/edifact/segments/unh.rb