Class: Eancom::Edifact::EFI
- Defined in:
- lib/eancom/edifact/segments/efi.rb
Constant Summary collapse
- TAG =
'EFI'.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, file_name: nil, file_format_name:, data_format_description_code:) ⇒ EFI
constructor
A new instance of EFI.
- #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, file_name: nil, file_format_name:, data_format_description_code:) ⇒ EFI
Returns a new instance of EFI.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/eancom/edifact/segments/efi.rb', line 9 def initialize( tag: nil, file_name: nil, file_format_name:, data_format_description_code: ) @tag = tag @file_name = file_name @file_format_name = file_format_name @data_format_description_code = data_format_description_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/efi.rb', line 7 def segment_type @segment_type end |
Instance Method Details
#to_json_hash ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/eancom/edifact/segments/efi.rb', line 25 def to_json_hash hash = {} hash.merge!(file_name: file_name) if @file_name hash.merge!(file_format_name: file_format_name) if @file_format_name hash.merge!(data_format_description_code: find_identifier(:data_format_description_code)) if @data_format_description_code hash end |