ach 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 640ebc0be481db30c9a5fd56865f3d984b0658ce
4
- data.tar.gz: 76af2b39c29a612397c9ab8f29a4e5f867651397
3
+ metadata.gz: 93dcda27d9c612ed456234167e8eca10bfc18fd0
4
+ data.tar.gz: 66883d9ffd765fc5c9a04b9c0745a08d1caf31c1
5
5
  SHA512:
6
- metadata.gz: e605508ea87917f3bf44cba94f624c00a6e72abd9aeba134994875f5e91d1dc49366fb7dfd81b60d6dafaff072d76781962e4304846f19baa444fc4605cae80d
7
- data.tar.gz: 280b956b06681c46ed3bddeb58294680d1e81982b7a8548214f1441c9bd2386c5b906bf56b0e16f493e16af096af6e0d7e8384212b80f2ab022d32b5e48ba741
6
+ metadata.gz: 2ebede0a464a3d89bb8ee504ecd3b2077af78adef060c53b64b8d123339a61047f56987e209d669c2985a740c08327dbbc4ef3c2713c7a6d9c34e9c409f3a6b0
7
+ data.tar.gz: ab13aa63e7b806bd8937d4bd0fcecde53f3802441abdff4f9c237a56a43e6a0705f8a1a969068a56bddfa9cfafdda21ffd24f541a060614fd59e1bb4dc26915d
@@ -25,7 +25,11 @@ module ACH
25
25
  def to_s
26
26
  records = []
27
27
  records << @header
28
- @batches.each { |b| records += b.to_ach }
28
+
29
+ @batches.each_with_index do |batch, index|
30
+ batch.header.batch_number ||= index + 1
31
+ records += batch.to_ach
32
+ end
29
33
  records << @control
30
34
 
31
35
  nines_needed = 10 - (records.length % 10)
@@ -33,6 +33,6 @@ module ACH::Records
33
33
  field :originating_dfi_identification, String,
34
34
  nil, nil, /\A\d{8}\z/
35
35
 
36
- field :batch_number, Integer, lambda { |f| sprintf('%07d', f)}, 1
36
+ field :batch_number, Integer, lambda { |f| sprintf('%07d', f)}, nil
37
37
  end
38
38
  end
@@ -1,3 +1,3 @@
1
1
  module ACH
2
- VERSION = '0.5.3'.freeze
2
+ VERSION = '0.5.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ach
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Morgan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-12-03 00:00:00.000000000 Z
12
+ date: 2016-12-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: appraisal