Class: FinTS::Segment::HNHBK

Inherits:
BaseSegment show all
Defined in:
lib/fints/segment/hnhbk.rb

Overview

HNHBK (Nachrichtenkopf) Section B.5.2

Constant Summary collapse

HEADER_LENGTH =
29

Instance Attribute Summary

Attributes inherited from BaseSegment

#segmentno

Instance Method Summary collapse

Methods inherited from BaseSegment

#to_s

Constructor Details

#initialize(msglen, dialog_id, msg_no) ⇒ HNHBK

Returns a new instance of HNHBK.



8
9
10
11
12
13
14
# File 'lib/fints/segment/hnhbk.rb', line 8

def initialize(msglen, dialog_id, msg_no)
  if msglen.to_s.length != 12
    msglen = (msglen.to_i + HEADER_LENGTH + dialog_id.to_s.length + msg_no.to_s.length).to_s.rjust(12, '0')
  end
  data = [msglen, 300, dialog_id, msg_no]
  super(1, data)
end