Class: Eancom::Edifact::UNA
- Defined in:
- lib/eancom/edifact/segments/una.rb
Constant Summary collapse
- TAG =
'UNA'.freeze
- TYPE =
:header.freeze
Instance Attribute Summary collapse
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
-
#una1 ⇒ Object
readonly
Returns the value of attribute una1.
-
#una2 ⇒ Object
readonly
Returns the value of attribute una2.
-
#una3 ⇒ Object
readonly
Returns the value of attribute una3.
-
#una4 ⇒ Object
readonly
Returns the value of attribute una4.
-
#una5 ⇒ Object
readonly
Returns the value of attribute una5.
-
#una6 ⇒ Object
readonly
Returns the value of attribute una6.
Instance Method Summary collapse
-
#initialize(tag: nil, una1: ':', una2: '+', una3: '.', una4: '?', una5: ' ', una6: '\'') ⇒ UNA
constructor
A new instance of UNA.
- #segment_type ⇒ Object
- #to_json_hash ⇒ Object
- #to_s ⇒ 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, #validate_structure
Constructor Details
#initialize(tag: nil, una1: ':', una2: '+', una3: '.', una4: '?', una5: ' ', una6: '\'') ⇒ UNA
Returns a new instance of UNA.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/eancom/edifact/segments/una.rb', line 9 def initialize(tag: nil, una1: ':', una2: '+', una3: '.', una4: '?', una5: ' ', una6: '\'' ) @tag = tag @una1 = una1 @una2 = una2 @una3 = una3 @una4 = una4 @una5 = una5 @una6 = una6 super(tag: (tag || TAG)) end |
Instance Attribute Details
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
7 8 9 |
# File 'lib/eancom/edifact/segments/una.rb', line 7 def tag @tag end |
#una1 ⇒ Object (readonly)
Returns the value of attribute una1.
7 8 9 |
# File 'lib/eancom/edifact/segments/una.rb', line 7 def una1 @una1 end |
#una2 ⇒ Object (readonly)
Returns the value of attribute una2.
7 8 9 |
# File 'lib/eancom/edifact/segments/una.rb', line 7 def una2 @una2 end |
#una3 ⇒ Object (readonly)
Returns the value of attribute una3.
7 8 9 |
# File 'lib/eancom/edifact/segments/una.rb', line 7 def una3 @una3 end |
#una4 ⇒ Object (readonly)
Returns the value of attribute una4.
7 8 9 |
# File 'lib/eancom/edifact/segments/una.rb', line 7 def una4 @una4 end |
#una5 ⇒ Object (readonly)
Returns the value of attribute una5.
7 8 9 |
# File 'lib/eancom/edifact/segments/una.rb', line 7 def una5 @una5 end |
#una6 ⇒ Object (readonly)
Returns the value of attribute una6.
7 8 9 |
# File 'lib/eancom/edifact/segments/una.rb', line 7 def una6 @una6 end |
Instance Method Details
#segment_type ⇒ Object
45 46 47 |
# File 'lib/eancom/edifact/segments/una.rb', line 45 def segment_type TYPE end |
#to_json_hash ⇒ Object
41 42 43 |
# File 'lib/eancom/edifact/segments/una.rb', line 41 def to_json_hash {} end |
#to_s ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/eancom/edifact/segments/una.rb', line 29 def to_s stream = "" stream << tag stream << una1 stream << una2 stream << una3 stream << una4 stream << una5 stream << una6 stream end |