ach 0.4.5 → 0.4.6

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: 8bfd9520e3afb6094fcadedacdfdebabfdf84c19
4
- data.tar.gz: f2cfb5df41b903ae5e994bb23b5d8e1facc20b15
3
+ metadata.gz: cdb9053837eeecc586cc92d3854544a8cb129222
4
+ data.tar.gz: 61d0e597877cf8d3b7f2e7088e3d583269fcbd05
5
5
  SHA512:
6
- metadata.gz: 2519907b216fb98cb36b6bf8748ef0d014a021cdbda6a97bc653c7f72f7922ed05d1e1488d1f02096b60e5757bf33ae879fe271833d912188fdea93d5d2fa706
7
- data.tar.gz: 1d6e01c513a5bdeb6bd46374ec42f69d371ddd2116947f73aa6c40eee187a68b0d07159baaa9049ad36832dff6053f505b3747c0ff789c295b23e88f1c722b3e
6
+ metadata.gz: 25ce9dbaa3fd3363339eec02909d9a3b7bdfa2ab2d4ad47de2172b0fba23a8d8a071ef137c1cf0c72ed2f1669b74589af22c08d61696db520116968efc80cf55
7
+ data.tar.gz: 6f76e0aa10b531dc218f8fcf0233627d2c19dd1cff8e1ae1bc72e128a75366f6c8a224f33a1ddba904e18c852d7e5bae3df9a4787440a496b93781ba9b7f512e
@@ -1,15 +1,15 @@
1
1
  module ACH::Records
2
2
  class EntryDetail < Record
3
3
  CREDIT_RECORD_TRANSACTION_CODE_ENDING_DIGITS = ["0", "1", "2", "3", "4"]
4
-
4
+
5
5
  @fields = []
6
-
6
+
7
7
  attr_accessor :sorter
8
-
8
+
9
9
  const_field :record_type, '6'
10
10
  field :transaction_code, String,
11
11
  nil, nil, /\A\d{2}\z/
12
- spaceless_routing_field :routing_number # Receiving DFI Identification
12
+ spaceless_routing_field :routing_number # Receiving DFI Identification
13
13
  # and Check Digit
14
14
  field :account_number, String, lambda { |f| left_justify(f, 17)}
15
15
  field :amount, Integer, lambda { |f| sprintf('%010d', f)}
@@ -20,20 +20,21 @@ module ACH::Records
20
20
  lambda { |f| sprintf('%01d', f)}, 0
21
21
  field :originating_dfi_identification, String,
22
22
  nil, nil, /\A\d{8}\z/
23
- field :trace_number, Integer, lambda { |f| sprintf('%07d', f)}
24
-
23
+ field :trace_number, Integer, lambda { |f| sprintf('%07d', f)}, nil,
24
+ lambda { |n| n.to_s.length <= 7 }
25
+
25
26
  def credit?
26
27
  CREDIT_RECORD_TRANSACTION_CODE_ENDING_DIGITS.include?(@transaction_code[1..1])
27
28
  end
28
-
29
+
29
30
  def debit?
30
31
  !credit?
31
32
  end
32
-
33
+
33
34
  def amount_value
34
35
  return self.amount
35
36
  end
36
-
37
+
37
38
  end
38
39
 
39
40
  class CtxEntryDetail < EntryDetail
@@ -71,7 +72,7 @@ module ACH::Records
71
72
  ach_string << "\r\n" + a.to_ach
72
73
  }
73
74
  return ach_string
74
- end
75
+ end
75
76
 
76
77
  end
77
78
  end
@@ -1,3 +1,3 @@
1
1
  module ACH
2
- VERSION = '0.4.5'.freeze
2
+ VERSION = '0.4.6'.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.5
4
+ version: 0.4.6
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: 2013-07-04 00:00:00.000000000 Z
12
+ date: 2013-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: micronaut