Class: Eancom::Edifact::PGI
- Defined in:
- lib/eancom/edifact/segments/pgi.rb
Constant Summary collapse
- TAG =
'PGI'.freeze
- TYPE =
:body.freeze
Instance Attribute Summary collapse
-
#segment_type ⇒ Object
readonly
Returns the value of attribute segment_type.
Attributes inherited from Segment
Instance Method Summary collapse
-
#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) ⇒ PGI
constructor
A new instance of PGI.
- #to_json_hash ⇒ Object
Methods inherited from Segment
#array, #group_name, initialize_by_components, #is_body?, #is_footer?, #is_header?, #item_group_name, #starts_item?, #starts_location?, #starts_message?, #structure, #tag?, #to_edi, #to_hash, #to_s, #validate_structure
Constructor Details
#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) ⇒ PGI
Returns a new instance of PGI.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/eancom/edifact/segments/pgi.rb', line 9 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 |
Instance Attribute Details
#segment_type ⇒ Object (readonly)
Returns the value of attribute segment_type.
7 8 9 |
# File 'lib/eancom/edifact/segments/pgi.rb', line 7 def segment_type @segment_type end |
Instance Method Details
#to_json_hash ⇒ Object
27 28 29 30 31 |
# File 'lib/eancom/edifact/segments/pgi.rb', line 27 def to_json_hash hash = { 'product_group_identifier': identifier } end |