ach 0.4.10 → 0.4.11

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: 97e23049981832283f91fddbcd27d11e71b56474
4
- data.tar.gz: f74a8004fc31c65d7d4ab3b6d8ba88a8ee1c7548
3
+ metadata.gz: e13526411f782fff817d5b5594971d6eeb3a9c92
4
+ data.tar.gz: ff5a413b17ba618f8f74eba4da5256bdc5dbb11d
5
5
  SHA512:
6
- metadata.gz: 4bed4dd45fcccb7297b9348354fd28428304ffd0344afd2044a143d06e5e6f3c26b0b8cb5f6c151f33b6a527e346ee4681ef736f8700a8590931f87df515b5fa
7
- data.tar.gz: 627265288242992b6138ab190b61eebf2e9d8102eb8b87a8fe5f8eb0a56ebb860ae2b225a4972625e50e882f7d6d316df0c91b08ff8e3782508f85199feee754
6
+ metadata.gz: 51deac927aeab91dc4731356039279f901b090d405fadcaa3a152bdb3c8625ee3160f61e18642d1b26e36622c6638da658116bf2356297d3c70b7daed3df25db
7
+ data.tar.gz: cabed7bac706f480d57f691eaa3bc2eb96016708f2fe0d70ffa06da83682d482b1236899a663a53d799e143741c1ffda9960faa0e8a94ea33741c6672d66a59c
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  #ACH
2
2
 
3
- ![](https://travis-ci.org/jm81/ach.svg)
3
+ [![Build Status](https://travis-ci.org/jm81/ach.svg?branch=master)](https://travis-ci.org/jm81/ach)
4
4
 
5
5
  ach is a Ruby helper for builder ACH files. In particular, it helps with field
6
6
  order and alignment, and adds padding lines to end of file.
@@ -26,43 +26,40 @@ trace_number = 0
26
26
 
27
27
  # File Header
28
28
  fh = ach.header
29
- fh.immediate_destination = "000000000"
30
- fh.immediate_destination_name = "BANK NAME"
31
- fh.immediate_origin = "000000000"
32
- fh.immediate_origin_name = "BANK NAME"
29
+ fh.immediate_destination = '000000000'
30
+ fh.immediate_destination_name = 'BANK NAME'
31
+ fh.immediate_origin = '000000000'
32
+ fh.immediate_origin_name = 'BANK NAME'
33
33
 
34
34
  # Batch
35
35
  batch = ACH::Batch.new
36
36
  bh = batch.header
37
- bh.company_name = "Company Name"
38
- bh.company_identification = "123456789" # Use 10 characters if you're not using an EIN
37
+ bh.company_name = 'Company Name'
38
+ bh.company_identification = '123456789' # Use 10 characters if you're not using an EIN
39
39
  bh.standard_entry_class_code = 'PPD'
40
- bh.company_entry_description = "DESCRIPTION"
40
+ bh.company_entry_description = 'DESCRIPTION'
41
41
  bh.company_descriptive_date = Date.today
42
- bh.effective_entry_date = (Date.today + 1)
43
- bh.originating_dfi_identification = "00000000"
42
+ bh.effective_entry_date = ACH::NextFederalReserveEffectiveDate.new(Date.today).result
43
+ bh.originating_dfi_identification = '00000000'
44
44
  ach.batches << batch
45
45
 
46
46
  # Detail Entry
47
47
  ed = ACH::EntryDetail.new
48
48
  ed.transaction_code = ACH::CHECKING_CREDIT
49
- ed.routing_number = "000000000"
50
- ed.account_number = "00000000000"
49
+ ed.routing_number = '000000000'
50
+ ed.account_number = '00000000000'
51
51
  ed.amount = 100 # In cents
52
- ed.individual_id_number = "Employee Name"
53
- ed.individual_name = "Employee Name"
52
+ ed.individual_id_number = 'Employee Name'
53
+ ed.individual_name = 'Employee Name'
54
54
  ed.originating_dfi_identification = '00000000'
55
55
  batch.entries << ed
56
56
  # ... Additional detail entries, possibly including *offsetting entry*, if needed.
57
57
 
58
58
  # Insert trace numbers
59
- batch.entries.each{ |entry| entry.trace_number = (trace_number += 1) }
59
+ batch.entries.each.with_index(1) { |entry, index| entry.trace_number = index }
60
60
 
61
61
 
62
- output = ach.to_s
63
- File.open("ach.txt", 'w') do |f|
64
- f.write output
65
- end
62
+ File.write('ach.txt', ach.to_s)
66
63
 
67
64
  p ach.report
68
65
  ```
@@ -11,8 +11,11 @@ module ACH
11
11
 
12
12
  extend(FieldIdentifiers)
13
13
 
14
+ attr_accessor :case_sensitive
15
+
14
16
  def to_ach
15
- self.class.fields.collect { |f| send("#{f}_to_ach") }.join('').upcase
17
+ to_ach = self.class.fields.collect { |f| send("#{f}_to_ach") }.join('')
18
+ case_sensitive ? to_ach : to_ach.upcase
16
19
  end
17
20
  end
18
21
  end
@@ -1,3 +1,3 @@
1
1
  module ACH
2
- VERSION = '0.4.10'.freeze
2
+ VERSION = '0.4.11'.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.4.10
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Morgan
@@ -9,54 +9,54 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-21 00:00:00.000000000 Z
12
+ date: 2015-07-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - '>='
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rspec
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ~>
33
33
  - !ruby/object:Gem::Version
34
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
41
  version: '3.2'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: holidays
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - '>='
47
47
  - !ruby/object:Gem::Version
48
48
  version: 1.2.0
49
- - - "<"
49
+ - - <
50
50
  - !ruby/object:Gem::Version
51
51
  version: 3.0.0
52
52
  type: :runtime
53
53
  prerelease: false
54
54
  version_requirements: !ruby/object:Gem::Requirement
55
55
  requirements:
56
- - - ">="
56
+ - - '>='
57
57
  - !ruby/object:Gem::Version
58
58
  version: 1.2.0
59
- - - "<"
59
+ - - <
60
60
  - !ruby/object:Gem::Version
61
61
  version: 3.0.0
62
62
  description: ach is a Ruby helper for building and parsing ACH files. In particular,
@@ -67,22 +67,22 @@ extensions: []
67
67
  extra_rdoc_files:
68
68
  - README.md
69
69
  files:
70
- - MIT-LICENSE
71
- - README.md
72
70
  - lib/ach.rb
73
71
  - lib/ach/ach_file.rb
74
- - lib/ach/batch.rb
75
72
  - lib/ach/field_identifiers.rb
76
73
  - lib/ach/next_federal_reserve_effective_date.rb
74
+ - lib/ach/batch.rb
75
+ - lib/ach/version.rb
77
76
  - lib/ach/records/addendum.rb
78
- - lib/ach/records/batch_control.rb
79
- - lib/ach/records/batch_header.rb
80
- - lib/ach/records/entry_detail.rb
81
- - lib/ach/records/file_control.rb
77
+ - lib/ach/records/record.rb
82
78
  - lib/ach/records/file_header.rb
79
+ - lib/ach/records/entry_detail.rb
83
80
  - lib/ach/records/nines.rb
84
- - lib/ach/records/record.rb
85
- - lib/ach/version.rb
81
+ - lib/ach/records/batch_control.rb
82
+ - lib/ach/records/file_control.rb
83
+ - lib/ach/records/batch_header.rb
84
+ - MIT-LICENSE
85
+ - README.md
86
86
  homepage: https://github.com/jm81/ach
87
87
  licenses: []
88
88
  metadata: {}
@@ -92,17 +92,17 @@ require_paths:
92
92
  - lib
93
93
  required_ruby_version: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ">="
95
+ - - '>='
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - ">="
100
+ - - '>='
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  requirements: []
104
104
  rubyforge_project:
105
- rubygems_version: 2.2.2
105
+ rubygems_version: 2.0.14
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Helper for building ACH files