Sha256: 862785c67d01f60120012bd264fd024e9085fcdfb87d8816f7e73d3d4501123c
Contents?: true
Size: 1.09 KB
Versions: 16
Compression:
Stored size: 1.09 KB
Contents
module Eancom module Edifact class PGI < Segment TAG = 'PGI'.freeze TYPE = :body.freeze attr_reader :segment_type def initialize( tag: nil, product_group_type_code:, product_group_name_code: nil, code_list_identification_code: nil, code_list_responsibility_agency_code: nil, product_group_name: nil ) @tag = tag @product_group_type_code = product_group_type_code @product_group_name_code = product_group_name_code @code_list_identification_code = code_list_identification_code @code_list_responsibility_agency_code = code_list_responsibility_agency_code @product_group_name = product_group_name_code super(tag: tag || TAG) end def to_json_hash hash = { 'product_group_identifier': identifier } end def segment_type TYPE end private def identifier @identifier ||= structure.find(:product_group_type_code).dictionary[@product_group_type_code][:identifier] end end end end
Version data entries
16 entries across 16 versions & 1 rubygems