module Eancom module Edifact class TDT < Segment TAG = 'TDT'.freeze TYPE = :body.freeze def initialize( tag: nil, transport_stage_code_qualifier:, means_of_transport_journey_identifier: nil, transport_mode_name_code:, transport_means_description_code: nil, transport_means_description: nil, carrier_identifier: nil, code_list_identification_code_1: nil, code_list_responsible_agency_1: nil, carrier_name: nil, transit_direction_identicator_code: nil, transport_means_identification_name_identifier: nil, code_list_identification_code_2: nil, code_list_responsible_agency_2: nil, transport_means_identification_name: nil, transport_means_nationality_code: nil ) @tag = tag @transport_stage_code_qualifier = transport_stage_code_qualifier @means_of_transport_journey_identifier = means_of_transport_journey_identifier @transport_mode_name_code = transport_mode_name_code @transport_means_description_code = transport_means_description_code @transport_means_description = transport_means_description @carrier_identifier = carrier_identifier @code_list_identification_code_1 = code_list_identification_code_1 @code_list_responsible_agency_1 = code_list_responsible_agency_1 @carrier_name = carrier_name @transit_direction_identicator_code = transit_direction_identicator_code @transport_means_identification_name_identifier = transport_means_identification_name_identifier @code_list_identification_code_2 = code_list_identification_code_2 @code_list_responsible_agency_2 = code_list_responsible_agency_2 @transport_means_identification_name = transport_means_identification_name @transport_means_nationality_code = transport_means_nationality_code super(tag: tag || TAG) end def to_json_hash hash = {} hash.merge!(transport_stage_code_qualifier: find_identifier(:transport_stage_code_qualifier)) if @transport_stage_code_qualifier hash.merge!(transport_mode_name_code: find_identifier(:transport_mode_name_code)) if @transport_mode_name_code hash end def segment_type TYPE end end end end