ach 0.4.9 → 0.4.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/ach.rb +1 -0
- data/lib/ach/next_federal_reserve_effective_date.rb +40 -0
- data/lib/ach/version.rb +1 -1
- metadata +25 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97e23049981832283f91fddbcd27d11e71b56474
|
4
|
+
data.tar.gz: f74a8004fc31c65d7d4ab3b6d8ba88a8ee1c7548
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bed4dd45fcccb7297b9348354fd28428304ffd0344afd2044a143d06e5e6f3c26b0b8cb5f6c151f33b6a527e346ee4681ef736f8700a8590931f87df515b5fa
|
7
|
+
data.tar.gz: 627265288242992b6138ab190b61eebf2e9d8102eb8b87a8fe5f8eb0a56ebb860ae2b225a4972625e50e882f7d6d316df0c91b08ff8e3782508f85199feee754
|
data/README.md
CHANGED
data/lib/ach.rb
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'holidays'
|
2
|
+
|
3
|
+
module ACH
|
4
|
+
class NextFederalReserveEffectiveDate
|
5
|
+
def initialize(submission_date)
|
6
|
+
@submission_date = submission_date
|
7
|
+
end
|
8
|
+
|
9
|
+
def result
|
10
|
+
@result = @submission_date
|
11
|
+
advance_to_next_business_day
|
12
|
+
advance_extra_day_if_submission_date_is_holiday_or_weekend
|
13
|
+
@result
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def advance_extra_day_if_submission_date_is_holiday_or_weekend
|
19
|
+
if holiday_or_weekend?(@submission_date)
|
20
|
+
advance_to_next_business_day
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def advance_to_next_business_day
|
25
|
+
@result = @result.next_day
|
26
|
+
|
27
|
+
while holiday_or_weekend?(@result)
|
28
|
+
@result = @result.next_day
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def holiday?(date)
|
33
|
+
Holidays.on(date, :federal_reserve).any?
|
34
|
+
end
|
35
|
+
|
36
|
+
def holiday_or_weekend?(date)
|
37
|
+
date.saturday? || date.sunday? || holiday?(date)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/ach/version.rb
CHANGED
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.4.
|
4
|
+
version: 0.4.10
|
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: 2015-
|
12
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -31,14 +31,34 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '2
|
34
|
+
version: '3.2'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '2
|
41
|
+
version: '3.2'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: holidays
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 1.2.0
|
49
|
+
- - "<"
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: 3.0.0
|
52
|
+
type: :runtime
|
53
|
+
prerelease: false
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: 1.2.0
|
59
|
+
- - "<"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.0.0
|
42
62
|
description: ach is a Ruby helper for building and parsing ACH files. In particular,
|
43
63
|
it helps with field order and alignment, and adds padding lines to end of file.
|
44
64
|
email: jmorgan@morgancreative.net
|
@@ -53,6 +73,7 @@ files:
|
|
53
73
|
- lib/ach/ach_file.rb
|
54
74
|
- lib/ach/batch.rb
|
55
75
|
- lib/ach/field_identifiers.rb
|
76
|
+
- lib/ach/next_federal_reserve_effective_date.rb
|
56
77
|
- lib/ach/records/addendum.rb
|
57
78
|
- lib/ach/records/batch_control.rb
|
58
79
|
- lib/ach/records/batch_header.rb
|