Class: ABO::Writer

Inherits:
Object
  • Object
show all
Defined in:
lib/abo.rb

Defined Under Namespace

Classes: FileHeader, GroupHeader, PaymentOrder, Record

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWriter

Returns a new instance of Writer.



163
164
165
166
167
168
169
170
# File 'lib/abo.rb', line 163

def initialize
  @record = Record.new
  @record.interval_start = 1
  @record.interval_stop = 1
  @file_header = FileHeader.new
  @group_header = GroupHeader.new
  @payment_orders = []
end

Instance Attribute Details

#file_headerObject

Hlavička účetního souboru



10
11
12
# File 'lib/abo.rb', line 10

def file_header
  @file_header
end

#group_headerObject

Hlavička skupiny



13
14
15
# File 'lib/abo.rb', line 13

def group_header
  @group_header
end

#payment_orderObject

Položka jednotlivého příkazu



16
17
18
# File 'lib/abo.rb', line 16

def payment_order
  @payment_order
end

#recordObject

záznam UHL1



7
8
9
# File 'lib/abo.rb', line 7

def record
  @record
end

Instance Method Details

#to_aboObject



172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/abo.rb', line 172

def to_abo
  prepare
  string = ""
  string << @record.to_abo
  string << @file_header.to_abo
  string << @group_header.to_abo
  @payment_orders.each do |p|
    string << p.to_abo
  end
  string << @group_header.end_block
  string << @file_header.end_block
  
  string
end