Class: Eancom::Edifact::DTM
- Defined in:
- lib/eancom/edifact/segments/dtm.rb
Constant Summary collapse
- TAG =
'DTM'.freeze
- TYPE =
:body.freeze
Instance Attribute Summary collapse
-
#date_time ⇒ Object
Returns the value of attribute date_time.
-
#format ⇒ Object
Returns the value of attribute format.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Segment
Instance Method Summary collapse
-
#initialize(tag: nil, type:, date_time:, format:) ⇒ DTM
constructor
A new instance of DTM.
- #segment_type ⇒ Object
- #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, type:, date_time:, format:) ⇒ DTM
Returns a new instance of DTM.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/eancom/edifact/segments/dtm.rb', line 9 def initialize( tag: nil, type:, date_time:, format: ) @tag = tag @type = type @date_time = date_time @format = format super(tag: @tag || TAG) end |
Instance Attribute Details
#date_time ⇒ Object
Returns the value of attribute date_time.
7 8 9 |
# File 'lib/eancom/edifact/segments/dtm.rb', line 7 def date_time @date_time end |
#format ⇒ Object
Returns the value of attribute format.
7 8 9 |
# File 'lib/eancom/edifact/segments/dtm.rb', line 7 def format @format end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/eancom/edifact/segments/dtm.rb', line 7 def type @type end |
Instance Method Details
#segment_type ⇒ Object
31 32 33 |
# File 'lib/eancom/edifact/segments/dtm.rb', line 31 def segment_type TYPE end |
#to_json_hash ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/eancom/edifact/segments/dtm.rb', line 23 def to_json_hash { identifier => { date_time: @date_time } } end |