Class: Headache::Record::FileControl
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Base
fields, #normalize_field_value, normalize_field_value, #parse, parse_fields, #parse_fields, parse_fields_normalize, #to_h
Constructor Details
#initialize(document = nil) ⇒ FileControl
Returns a new instance of FileControl.
8
9
10
|
# File 'lib/headache/record/file_control.rb', line 8
def initialize(document = nil)
@document = document
end
|
Instance Attribute Details
#document ⇒ Object
Returns the value of attribute document.
6
7
8
|
# File 'lib/headache/record/file_control.rb', line 6
def document
@document
end
|
Instance Method Details
#batch_count ⇒ Object
12
13
14
|
# File 'lib/headache/record/file_control.rb', line 12
def batch_count
document.batches.count
end
|
#block_count ⇒ Object
16
17
18
|
# File 'lib/headache/record/file_control.rb', line 16
def block_count
(((batch_count * 2) + document.entries.count + 2) / 10.0).ceil
end
|
#entry_count ⇒ Object
20
21
22
|
# File 'lib/headache/record/file_control.rb', line 20
def entry_count
document.entries.count
end
|
#entry_hash ⇒ Object
24
25
26
|
# File 'lib/headache/record/file_control.rb', line 24
def entry_hash
batch_sum(:entry_hash).to_s.last(10)
end
|
#total_credit ⇒ Object
32
33
34
|
# File 'lib/headache/record/file_control.rb', line 32
def total_credit
batch_sum :total_credit
end
|
#total_debit ⇒ Object
28
29
30
|
# File 'lib/headache/record/file_control.rb', line 28
def total_debit
batch_sum :total_debit
end
|