ach 0.5.6 → 0.5.7

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
  SHA1:
3
- metadata.gz: 32df35a4254438af8c1fb48e4267a8aaf42b7f9f
4
- data.tar.gz: b384f99cf3035f70d00556d4dff8c913793ce00a
3
+ metadata.gz: e4acdd7cd46577d18bd21b38f7acb358185f05de
4
+ data.tar.gz: c6c79c9ea05ebf3b4a0f1f0aec01dcdac054ea71
5
5
  SHA512:
6
- metadata.gz: e9931a690d14af47b9e9208a936c6a032066eceed8515e766ea4ecab2510564c762fe313c2c77ca71aa909bf3c4d1ea4ae79af3f1e3dca790f66c2d48b42d2d5
7
- data.tar.gz: 2426fc6baa475350767fc7818ee255088b7b6ccc56d0a6945a612fb461a6c11b5dc6c816f976a8fd599ffb06314251d2ab312ad4a3c9cbdca48a2229f878b252
6
+ metadata.gz: 6f2b15b83d7bfb77cb0e8d7ca6ed0891d0c00caa17fcd18e8cba20538aee6da9f8a2cfce1e4a7eca636528a256e18546b7ff1c5dd4ee4524b672b79b6477a568
7
+ data.tar.gz: 8a6a2e3436e4989c54652b917cf647fdf551c025ba51fbefcf07405032bade41635481a24ad311f5480e8317bc70d877b59b759af542245e487a30fadffb7ce0
data/lib/ach.rb CHANGED
@@ -32,6 +32,7 @@ require 'ach/ach_file'
32
32
  require 'ach/batch'
33
33
  require 'ach/next_federal_reserve_effective_date'
34
34
  require 'ach/version'
35
+ require 'ach/string_formatting_helper'
35
36
 
36
37
  # Require records files
37
38
  require 'ach/records/record'
@@ -22,8 +22,9 @@ module ACH::Records
22
22
  lambda { |f| f.upcase }, 'PPD', /\A\w{3}\z/
23
23
  field :company_entry_description, String,
24
24
  lambda { |f| left_justify(f, 10)}
25
+ # This field allows for marking the batch as same-day for the bank by passing in ex: SD1300
25
26
  field :company_descriptive_date, Time,
26
- lambda { |f| f.strftime('%y%m%d')},
27
+ ACH::StringFormattingHelper.method(:stringify_with_same_day).to_proc,
27
28
  lambda { Time.now }
28
29
  field :effective_entry_date, Time,
29
30
  lambda { |f| f.strftime('%y%m%d')}
@@ -0,0 +1,9 @@
1
+ module ACH
2
+ module StringFormattingHelper
3
+ # Passing in SD to the date signifies same-day to banks. This is used for the company_descriptive_date
4
+ def self.stringify_with_same_day(f)
5
+ return f.upcase if f.to_s.upcase.match(/^SD\d+$/)
6
+ f.strftime('%y%m%d')
7
+ end
8
+ end
9
+ end
data/lib/ach/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ACH
2
- VERSION = '0.5.6'.freeze
2
+ VERSION = '0.5.7'.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.6
4
+ version: 0.5.7
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: 2017-01-13 00:00:00.000000000 Z
12
+ date: 2017-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: appraisal
@@ -110,6 +110,7 @@ files:
110
110
  - lib/ach/records/file_header.rb
111
111
  - lib/ach/records/nines.rb
112
112
  - lib/ach/records/record.rb
113
+ - lib/ach/string_formatting_helper.rb
113
114
  - lib/ach/version.rb
114
115
  homepage: https://github.com/jm81/ach
115
116
  licenses: []