ibandit 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/ibandit/check_digit.rb +2 -1
- data/lib/ibandit/version.rb +1 -1
- data/spec/ibandit/check_digit_spec.rb +12 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e111a4944bba7c9a8077ea70d7a7d7215d1e7021
|
4
|
+
data.tar.gz: e0c2e9b2e45385821107e4d4fac61ed1a39d531d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d81d40958cfe6397b2ae15b88ec4d27638c8da1651c8da6f0ed791c6c6e2ed016f1b1e7fb29bd2a438aad93335289ba7341ec894f6d774c7ae9526530518bf7
|
7
|
+
data.tar.gz: de83146c2c3646982550bd44634696223280e9f18fd48268813a3965dc6fd383af41a32900df98f9ff4821e859b7b09f4a2600f6ba3b575ad97400a7fdf55a6f
|
data/CHANGELOG.md
CHANGED
data/lib/ibandit/check_digit.rb
CHANGED
@@ -63,7 +63,8 @@ module Ibandit
|
|
63
63
|
# of a Belgian account number when given the first ten digits.
|
64
64
|
def self.belgian(string)
|
65
65
|
remainder = string.to_i % 97
|
66
|
-
format('%02d', remainder)
|
66
|
+
return format('%02d', remainder) unless remainder.zero?
|
67
|
+
"97"
|
67
68
|
end
|
68
69
|
|
69
70
|
# Currently unused in this gem. This method calculates the last digit
|
data/lib/ibandit/version.rb
CHANGED
@@ -39,6 +39,18 @@ describe Ibandit::CheckDigit do
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
describe '.belgian' do
|
43
|
+
subject { described_class.belgian(account_number) }
|
44
|
+
|
45
|
+
let(:account_number) { '5100075470' }
|
46
|
+
it { is_expected.to eq('61') }
|
47
|
+
|
48
|
+
context 'with an account number which is a factor of 97' do
|
49
|
+
let(:account_number) { '1030343409' }
|
50
|
+
it { is_expected.to eq('97') }
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
42
54
|
describe '.lund' do
|
43
55
|
subject { described_class.lund(account_number) }
|
44
56
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ibandit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grey Baker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -164,8 +164,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
version: '0'
|
165
165
|
requirements: []
|
166
166
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.
|
167
|
+
rubygems_version: 2.4.1
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: Convert national banking details into IBANs, and vice-versa.
|
171
171
|
test_files: []
|
172
|
+
has_rdoc:
|