Class: Eancom::Edifact::CDI
- Defined in:
- lib/eancom/edifact/segments/cdi.rb
Constant Summary collapse
- TAG =
'CDI'.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, physical_or_logical_state_type_code_qualifier: nil) ⇒ CDI
constructor
A new instance of CDI.
- #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_message?, #structure, #tag?, #to_edi, #to_hash, #to_s, #validate_structure
Constructor Details
#initialize(tag: nil, physical_or_logical_state_type_code_qualifier: nil) ⇒ CDI
Returns a new instance of CDI.
9 10 11 12 13 14 15 16 17 |
# File 'lib/eancom/edifact/segments/cdi.rb', line 9 def initialize( tag: nil, physical_or_logical_state_type_code_qualifier: nil ) @tag = tag @physical_or_logical_state_type_code_qualifier = physical_or_logical_state_type_code_qualifier 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/cdi.rb', line 7 def segment_type @segment_type end |
Instance Method Details
#to_json_hash ⇒ Object
19 20 21 22 23 |
# File 'lib/eancom/edifact/segments/cdi.rb', line 19 def to_json_hash hash = {} hash.merge!(physical_or_logical_state_type_code_qualifier: find_identifier(:physical_or_logical_state_type_code_qualifier)) if @physical_or_logical_state_type_code_qualifier hash end |