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