Class: RBEDI::FunctionalGroup
- Inherits:
-
Object
- Object
- RBEDI::FunctionalGroup
- Includes:
- Codes
- Defined in:
- lib/rbedi/functional_group.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
-
#application_receiver_code ⇒ Object
Returns the value of attribute application_receiver_code.
-
#application_sender_code ⇒ Object
Returns the value of attribute application_sender_code.
-
#date_time ⇒ Object
Returns the value of attribute date_time.
-
#functional_identifier_code ⇒ Object
Returns the value of attribute functional_identifier_code.
-
#group_control_number ⇒ Object
Returns the value of attribute group_control_number.
-
#transaction_sets ⇒ Object
Returns the value of attribute transaction_sets.
Instance Method Summary collapse
- #header ⇒ Object
-
#initialize(group_control_number:, functional_identifier_code:, application_sender_code:, application_receiver_code:, date_time: DateTime.now, transaction_sets: []) ⇒ FunctionalGroup
constructor
A new instance of FunctionalGroup.
- #to_s ⇒ Object
- #trailer ⇒ Object
Constructor Details
#initialize(group_control_number:, functional_identifier_code:, application_sender_code:, application_receiver_code:, date_time: DateTime.now, transaction_sets: []) ⇒ FunctionalGroup
Returns a new instance of FunctionalGroup.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rbedi/functional_group.rb', line 5 def initialize( group_control_number:, functional_identifier_code:, application_sender_code:, application_receiver_code:, date_time: DateTime.now, transaction_sets: [] ) @group_control_number = group_control_number.to_s @functional_identifier_code = functional_identifier_code @application_sender_code = application_sender_code @application_receiver_code = application_receiver_code @transaction_sets = transaction_sets @date_time = EDIDateTime.new(date_time) end |
Instance Attribute Details
#application_receiver_code ⇒ Object
Returns the value of attribute application_receiver_code.
49 50 51 |
# File 'lib/rbedi/functional_group.rb', line 49 def application_receiver_code @application_receiver_code end |
#application_sender_code ⇒ Object
Returns the value of attribute application_sender_code.
49 50 51 |
# File 'lib/rbedi/functional_group.rb', line 49 def application_sender_code @application_sender_code end |
#date_time ⇒ Object
Returns the value of attribute date_time.
49 50 51 |
# File 'lib/rbedi/functional_group.rb', line 49 def date_time @date_time end |
#functional_identifier_code ⇒ Object
Returns the value of attribute functional_identifier_code.
49 50 51 |
# File 'lib/rbedi/functional_group.rb', line 49 def functional_identifier_code @functional_identifier_code end |
#group_control_number ⇒ Object
Returns the value of attribute group_control_number.
49 50 51 |
# File 'lib/rbedi/functional_group.rb', line 49 def group_control_number @group_control_number end |
#transaction_sets ⇒ Object
Returns the value of attribute transaction_sets.
49 50 51 |
# File 'lib/rbedi/functional_group.rb', line 49 def transaction_sets @transaction_sets end |
Instance Method Details
#header ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rbedi/functional_group.rb', line 27 def header Segment.new( :functional_group_header, functional_identifier_code: @functional_identifier_code, application_sender_code: @application_sender_code, application_receiver_code: @application_receiver_code, date: @date_time.ccyymmdd, time: @date_time.hhmm, group_control_number: @group_control_number, responsible_agency_code: :accredited_standards_committee_x12, version_code: Codes::VERSION_CODE ) end |
#to_s ⇒ Object
21 22 23 24 25 |
# File 'lib/rbedi/functional_group.rb', line 21 def to_s header.to_s + @transaction_sets.map(&:to_s).join + trailer.to_s end |