Class: RBEDI::TransactionSet
- Inherits:
-
Object
- Object
- RBEDI::TransactionSet
- Includes:
- Codes
- Defined in:
- lib/rbedi/transaction_set.rb
Constant Summary
Constants included from Codes
Codes::ELEMENT_SEPARATOR, Codes::INTERCHANGE_CONTROL_VERSION_NUMBER, Codes::SEGMENT_TERMINATOR, Codes::VERSION_CODE
Instance Attribute Summary collapse
-
#segments ⇒ Object
Returns the value of attribute segments.
-
#transaction_set_control_number ⇒ Object
Returns the value of attribute transaction_set_control_number.
-
#transaction_set_identifier_code ⇒ Object
Returns the value of attribute transaction_set_identifier_code.
Instance Method Summary collapse
- #header ⇒ Object
-
#initialize(transaction_set_control_number:, segments: [], transaction_set_identifier_code:) ⇒ TransactionSet
constructor
A new instance of TransactionSet.
- #to_s ⇒ Object
- #trailer ⇒ Object
Constructor Details
#initialize(transaction_set_control_number:, segments: [], transaction_set_identifier_code:) ⇒ TransactionSet
Returns a new instance of TransactionSet.
5 6 7 8 9 10 11 12 13 |
# File 'lib/rbedi/transaction_set.rb', line 5 def initialize( transaction_set_control_number:, segments: [], transaction_set_identifier_code: ) @transaction_set_control_number = "%04d" % transaction_set_control_number @transaction_set_identifier_code = transaction_set_identifier_code @segments = segments end |
Instance Attribute Details
#segments ⇒ Object
Returns the value of attribute segments.
38 39 40 |
# File 'lib/rbedi/transaction_set.rb', line 38 def segments @segments end |
#transaction_set_control_number ⇒ Object
Returns the value of attribute transaction_set_control_number.
38 39 40 |
# File 'lib/rbedi/transaction_set.rb', line 38 def transaction_set_control_number @transaction_set_control_number end |
#transaction_set_identifier_code ⇒ Object
Returns the value of attribute transaction_set_identifier_code.
38 39 40 |
# File 'lib/rbedi/transaction_set.rb', line 38 def transaction_set_identifier_code @transaction_set_identifier_code end |
Instance Method Details
#header ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/rbedi/transaction_set.rb', line 21 def header Segment.new( :transaction_set_header, transaction_set_identifier_code: @transaction_set_identifier_code, transaction_set_control_number: @transaction_set_control_number, implementation_convention_reference: Codes::VERSION_CODE ) end |
#to_s ⇒ Object
15 16 17 18 19 |
# File 'lib/rbedi/transaction_set.rb', line 15 def to_s header.to_s + @segments.map(&:to_s).join + trailer.to_s end |