ach 0.5.14 → 0.5.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e5f1395339d4e7c0b808f591e4f82338e034f3c580b699e123f6842d999bc2f
4
- data.tar.gz: fedbb702874ed9e6b755d85965e0430133e6c2620d2ed129b7869c406ff8467b
3
+ metadata.gz: 47cf36089c143696101199550d31fdd5aea383384e76598293aed62a9ae0a899
4
+ data.tar.gz: bd4592f80dc44dda3e1387754a8f1bdd95694b9cb06b65dde585cfe0284da6e4
5
5
  SHA512:
6
- metadata.gz: f943fc37494ab4b6da0e81a711706e0e4a5144df7c82cb22d8c675adcb192b8e83d4dfafabd64c214363174dad485ce0d573bd3e3355aa1a76ef6ae505fb3b90
7
- data.tar.gz: 9b28ab754d56ab011ca25e8598084d6e8141d5ad444ca2abd3bad21f64c4854272ac21b7c66ef61c636809a0f6d4125d5919d1892c488d118eb12ff2535593ea
6
+ metadata.gz: 7e8b3e3029633dd32d0aa58ff50d9cf7a3bbacc473d6d6b5e56095ae4bdefb3efc571382ab52f8064b5fda8589da1192becb5edd054ee688eec6545ac9538dd7
7
+ data.tar.gz: 86e6069ff804c2490e7eb0adc934be78236828c83ea45a862e9a7e1dabc531042083dbf03fcac24a3c1054aa8fdc759ddc894e5d7309dff90d5eb69d9d965f59
@@ -22,6 +22,7 @@ module ACH
22
22
  end
23
23
  end
24
24
 
25
+
25
26
  # @param eol [String] Line ending, default to CRLF
26
27
  def to_s eol = "\r\n"
27
28
  records = []
@@ -33,16 +34,14 @@ module ACH
33
34
  end
34
35
  records << @control
35
36
 
36
- records_count = records.inject(0) do |sum, record|
37
- sum + record.records_count
38
- end
39
-
37
+ records_count = records.map(&:records_count).reduce(:+)
40
38
  nines_needed = (10 - records_count) % 10
41
39
  nines_needed = nines_needed % 10
42
40
  nines_needed.times { records << Records::Nines.new() }
43
41
 
42
+ records_count = records.map(&:records_count).reduce(:+)
44
43
  @control.batch_count = @batches.length
45
- @control.block_count = (records.length / 10).ceil
44
+ @control.block_count = (records_count / 10).ceil
46
45
 
47
46
  @control.entry_count = 0
48
47
  @control.debit_total = 0
@@ -14,7 +14,7 @@ module ACH
14
14
  end
15
15
 
16
16
  def to_ach
17
- @control.entry_count = @entries.inject(0) { |total, entry| total + entry.records_count }
17
+ @control.entry_count = @entries.map(&:records_count).reduce(:+).to_i
18
18
  @control.debit_total = 0
19
19
  @control.credit_total = 0
20
20
  @control.entry_hash = 0
@@ -1,3 +1,3 @@
1
1
  module ACH
2
- VERSION = '0.5.14'.freeze
2
+ VERSION = '0.5.15'.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.14
4
+ version: 0.5.15
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: 2020-05-16 00:00:00.000000000 Z
12
+ date: 2020-07-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: appraisal