ibandit 0.10.1 → 0.11.0

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: 16d9f9710f2ca0b2a51419ded2aad6802f7aaafc
4
- data.tar.gz: 75d27bc6692e06f6c2c570964043eb1397f87134
3
+ metadata.gz: 667772c48ae68431b4fbf9e883c4b77c8a927a76
4
+ data.tar.gz: 52e54aa3e0562ffd2193ceaf513b56b926d5b257
5
5
  SHA512:
6
- metadata.gz: f80aa8e5c0f21c8d861ba122a89b67d245632644c5d8aaa74e029cac0ddb3f872da8fb00d1be70450516c072f33418c9f3344ba81f3d0c2838331ef2a05df665
7
- data.tar.gz: 181b16f352338339890e1c73ab8b4581baa4268342dd9d5b860422fb927cfef1278e7e5eddf1c4649041154f353097c17fe2b758b2fdb0ff58f890eb363ee5f6
6
+ metadata.gz: 4b0aeda99aa0a626ea0456459b60d498885c7d96e4f3b19adaabe3f12db757f2348fa18125ec01a72570339f19e8c7b668ff6ae1f699e2d17eefe420c13497e5
7
+ data.tar.gz: 32407e700521b885dd135974b79e52f6d468ba145e13df0741c2e4aced7674b5dfd5578a0bd8eee2788cb3384d1f54160d3747e29f7c332c3a76817b56939568
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.11.0 - March 7, 2016
2
+
3
+ - BREAKING CHANGE: Rename `IBAN#iban_national_id` to `IBAN#swift_national_id`.
4
+ See https://github.com/gocardless/ibandit/pull/69 for more details.
5
+
1
6
  ## 0.10.1 - March 7, 2016
2
7
 
3
8
  - Update BLZ data
data/README.md CHANGED
@@ -106,7 +106,7 @@ county combines them:
106
106
  `swift_account_number`
107
107
  : The account number for the account
108
108
 
109
- `iban_national_id`
109
+ `swift_national_id`
110
110
  : The national ID for the bank / branch as documented by SWIFT
111
111
 
112
112
  The SWIFT IBAN components are all available as methods on an `IBAN` object:
@@ -119,7 +119,7 @@ iban.check_digits # => "82"
119
119
  iban.swift_bank_code # => "WEST"
120
120
  iban.swift_branch_code # => "123456"
121
121
  iban.swift_account_number # => "98765432"
122
- iban.iban_national_id # => "WEST123456"
122
+ iban.swift_national_id # => "WEST123456"
123
123
  ```
124
124
 
125
125
  In addition, it is often useful to extract any local check digits from the IBAN.
@@ -16,7 +16,7 @@ class Country
16
16
  element 'account_number_position', as: :account_number_position
17
17
  element 'account_number_length', as: :account_number_length
18
18
  element 'iban_total_length', as: :total_length
19
- element 'iban_national_id_length', as: :iban_national_id_length
19
+ element 'iban_national_id_length', as: :national_id_length
20
20
  end
21
21
 
22
22
  class Report
@@ -37,7 +37,7 @@ def get_iban_structures(iban_structures_file, iban_registry_file)
37
37
  account_number_position: country.account_number_position.to_i,
38
38
  account_number_length: country.account_number_length.to_i,
39
39
  total_length: country.total_length.to_i,
40
- iban_national_id_length: country.iban_national_id_length.to_i
40
+ national_id_length: country.national_id_length.to_i
41
41
  }.merge(bban_formats[country.country_code])
42
42
  end
43
43
  end
data/data/structures.yml CHANGED
@@ -7,7 +7,7 @@ AD:
7
7
  :account_number_position: 13
8
8
  :account_number_length: 12
9
9
  :total_length: 24
10
- :iban_national_id_length: 8
10
+ :national_id_length: 8
11
11
  :bban_format: \d{4}\d{4}[A-Z0-9]{12}
12
12
  :bank_code_format: \d{4}
13
13
  :branch_code_format: \d{4}
@@ -20,7 +20,7 @@ AE:
20
20
  :account_number_position: 8
21
21
  :account_number_length: 16
22
22
  :total_length: 23
23
- :iban_national_id_length: 3
23
+ :national_id_length: 3
24
24
  :bban_format: \d{3}\d{16}
25
25
  :bank_code_format: \d{3}
26
26
  :account_number_format: \d{16}
@@ -32,7 +32,7 @@ AL:
32
32
  :account_number_position: 13
33
33
  :account_number_length: 16
34
34
  :total_length: 28
35
- :iban_national_id_length: 8
35
+ :national_id_length: 8
36
36
  :bban_format: \d{8}[A-Z0-9]{16}
37
37
  :bank_code_format: \d{3}
38
38
  :account_number_format: '[A-Z0-9]{16}'
@@ -45,7 +45,7 @@ AT:
45
45
  :account_number_position: 10
46
46
  :account_number_length: 11
47
47
  :total_length: 20
48
- :iban_national_id_length: 5
48
+ :national_id_length: 5
49
49
  :bban_format: \d{5}\d{11}
50
50
  :bank_code_format: \d{5}
51
51
  :account_number_format: \d{11}
@@ -57,7 +57,7 @@ AZ:
57
57
  :account_number_position: 9
58
58
  :account_number_length: 20
59
59
  :total_length: 28
60
- :iban_national_id_length: 4
60
+ :national_id_length: 4
61
61
  :bban_format: '[A-Z]{4}[A-Z0-9]{20}'
62
62
  :bank_code_format: '[A-Z]{4}'
63
63
  :account_number_format: '[A-Z0-9]{20}'
@@ -69,7 +69,7 @@ BA:
69
69
  :account_number_position: 11
70
70
  :account_number_length: 10
71
71
  :total_length: 20
72
- :iban_national_id_length: 3
72
+ :national_id_length: 3
73
73
  :bban_format: \d{3}\d{3}\d{8}\d{2}
74
74
  :bank_code_format: \d{3}
75
75
  :branch_code_format: \d{3}
@@ -82,7 +82,7 @@ BE:
82
82
  :account_number_position: 5
83
83
  :account_number_length: 12
84
84
  :total_length: 16
85
- :iban_national_id_length: 3
85
+ :national_id_length: 3
86
86
  :bban_format: \d{3}\d{7}\d{2}
87
87
  :bank_code_format: \d{3}
88
88
  :account_number_format: \d{7}\d{2}
@@ -96,7 +96,7 @@ BG:
96
96
  :account_number_position: 13
97
97
  :account_number_length: 10
98
98
  :total_length: 22
99
- :iban_national_id_length: 8
99
+ :national_id_length: 8
100
100
  :bban_format: '[A-Z]{4}\d{4}\d{2}[A-Z0-9]{8}'
101
101
  :bank_code_format: '[A-Z]{4}'
102
102
  :branch_code_format: \d{4}
@@ -109,7 +109,7 @@ BH:
109
109
  :account_number_position: 9
110
110
  :account_number_length: 14
111
111
  :total_length: 22
112
- :iban_national_id_length: 4
112
+ :national_id_length: 4
113
113
  :bban_format: '[A-Z]{4}[A-Z0-9]{14}'
114
114
  :bank_code_format: '[A-Z]{4}'
115
115
  :account_number_format: '[A-Z0-9]{14}'
@@ -121,7 +121,7 @@ BR:
121
121
  :account_number_position: 18
122
122
  :account_number_length: 12
123
123
  :total_length: 29
124
- :iban_national_id_length: 8
124
+ :national_id_length: 8
125
125
  :bban_format: \d{8}\d{5}\d{10}[A-Z]{1}[A-Z0-9]{1}
126
126
  :bank_code_format: \d{8}
127
127
  :account_number_format: \d{10}[A-Z]{1}[A-Z0-9]{1}
@@ -134,7 +134,7 @@ CH:
134
134
  :account_number_position: 10
135
135
  :account_number_length: 12
136
136
  :total_length: 21
137
- :iban_national_id_length: 5
137
+ :national_id_length: 5
138
138
  :bban_format: \d{5}[A-Z0-9]{12}
139
139
  :bank_code_format: \d{5}
140
140
  :account_number_format: '[A-Z0-9]{12}'
@@ -146,7 +146,7 @@ CR:
146
146
  :account_number_position: 8
147
147
  :account_number_length: 14
148
148
  :total_length: 21
149
- :iban_national_id_length: 3
149
+ :national_id_length: 3
150
150
  :bban_format: \d{3}\d{14}
151
151
  :bank_code_format: \d{3}
152
152
  :account_number_format: \d{14}
@@ -158,7 +158,7 @@ CY:
158
158
  :account_number_position: 13
159
159
  :account_number_length: 16
160
160
  :total_length: 28
161
- :iban_national_id_length: 8
161
+ :national_id_length: 8
162
162
  :bban_format: \d{3}\d{5}[A-Z0-9]{16}
163
163
  :bank_code_format: \d{3}
164
164
  :branch_code_format: \d{5}
@@ -171,7 +171,7 @@ CZ:
171
171
  :account_number_position: 9
172
172
  :account_number_length: 16
173
173
  :total_length: 24
174
- :iban_national_id_length: 4
174
+ :national_id_length: 4
175
175
  :bban_format: \d{4}\d{6}\d{10}
176
176
  :bank_code_format: \d{4}
177
177
  :account_number_format: \d{6}\d{10}
@@ -183,7 +183,7 @@ DE:
183
183
  :account_number_position: 13
184
184
  :account_number_length: 10
185
185
  :total_length: 22
186
- :iban_national_id_length: 8
186
+ :national_id_length: 8
187
187
  :bban_format: \d{8}\d{10}
188
188
  :bank_code_format: \d{8}
189
189
  :account_number_format: \d{10}
@@ -195,7 +195,7 @@ DK:
195
195
  :account_number_position: 9
196
196
  :account_number_length: 10
197
197
  :total_length: 18
198
- :iban_national_id_length: 4
198
+ :national_id_length: 4
199
199
  :bban_format: \d{4}\d{9}\d{1}
200
200
  :bank_code_format: \d{4}
201
201
  :account_number_format: \d{9}\d{1}
@@ -207,7 +207,7 @@ DO:
207
207
  :account_number_position: 9
208
208
  :account_number_length: 20
209
209
  :total_length: 28
210
- :iban_national_id_length: 4
210
+ :national_id_length: 4
211
211
  :bban_format: '[A-Z0-9]{4}\d{20}'
212
212
  :bank_code_format: '[A-Z]{4}'
213
213
  :account_number_format: '{4}\d{20}'
@@ -219,7 +219,7 @@ EE:
219
219
  :account_number_position: 7
220
220
  :account_number_length: 14
221
221
  :total_length: 20
222
- :iban_national_id_length: 2
222
+ :national_id_length: 2
223
223
  :bban_format: \d{2}\d{2}\d{11}\d{1}
224
224
  :bank_code_format: '[1-9][0-9]'
225
225
  :account_number_format: \d{2}\d{11}\d{1}
@@ -233,7 +233,7 @@ ES:
233
233
  :account_number_position: 13
234
234
  :account_number_length: 12
235
235
  :total_length: 24
236
- :iban_national_id_length: 4
236
+ :national_id_length: 4
237
237
  :bban_format: \d{4}\d{4}\d{1}\d{1}\d{10}
238
238
  :bank_code_format: \d{4}
239
239
  :branch_code_format: \d{4}
@@ -248,7 +248,7 @@ FI:
248
248
  :account_number_position: 11
249
249
  :account_number_length: 8
250
250
  :total_length: 18
251
- :iban_national_id_length: 3
251
+ :national_id_length: 3
252
252
  :bban_format: \d{6}\d{7}\d{1}
253
253
  :bank_code_format: \d{6}
254
254
  :account_number_format: \d{7}\d{1}
@@ -262,7 +262,7 @@ FO:
262
262
  :account_number_position: 9
263
263
  :account_number_length: 10
264
264
  :total_length: 18
265
- :iban_national_id_length: 4
265
+ :national_id_length: 4
266
266
  :bban_format: \d{4}\d{9}\d{1}
267
267
  :bank_code_format: \d{4}
268
268
  :account_number_format: \d{9}\d{1}
@@ -274,7 +274,7 @@ FR:
274
274
  :account_number_position: 15
275
275
  :account_number_length: 13
276
276
  :total_length: 27
277
- :iban_national_id_length: 10
277
+ :national_id_length: 10
278
278
  :bban_format: \d{5}\d{5}[A-Z0-9]{11}\d{2}
279
279
  :bank_code_format: \d{5}
280
280
  :account_number_format: '[A-Z0-9]{11}\d{2}'
@@ -289,7 +289,7 @@ GB:
289
289
  :account_number_position: 15
290
290
  :account_number_length: 8
291
291
  :total_length: 22
292
- :iban_national_id_length: 10
292
+ :national_id_length: 10
293
293
  :bban_format: '[A-Z]{4}\d{6}\d{8}'
294
294
  :bank_code_format: '[A-Z]{4}'
295
295
  :account_number_format: \d{8}
@@ -302,7 +302,7 @@ GE:
302
302
  :account_number_position: 7
303
303
  :account_number_length: 16
304
304
  :total_length: 22
305
- :iban_national_id_length: 2
305
+ :national_id_length: 2
306
306
  :bban_format: '[A-Z]{2}\d{16}'
307
307
  :bank_code_format: '[A-Z]{2}'
308
308
  :account_number_format: \d{16}
@@ -314,7 +314,7 @@ GI:
314
314
  :account_number_position: 9
315
315
  :account_number_length: 15
316
316
  :total_length: 23
317
- :iban_national_id_length: 4
317
+ :national_id_length: 4
318
318
  :bban_format: '[A-Z]{4}[A-Z0-9]{15}'
319
319
  :bank_code_format: '[A-Z]{4}'
320
320
  :account_number_format: '[A-Z0-9]{15}'
@@ -326,7 +326,7 @@ GL:
326
326
  :account_number_position: 9
327
327
  :account_number_length: 10
328
328
  :total_length: 18
329
- :iban_national_id_length: 4
329
+ :national_id_length: 4
330
330
  :bban_format: \d{4}\d{9}\d{1}
331
331
  :bank_code_format: \d{4}
332
332
  :account_number_format: \d{9}\d{1}
@@ -338,7 +338,7 @@ GR:
338
338
  :account_number_position: 12
339
339
  :account_number_length: 16
340
340
  :total_length: 27
341
- :iban_national_id_length: 3
341
+ :national_id_length: 3
342
342
  :bban_format: \d{3}\d{4}[A-Z0-9]{16}
343
343
  :bank_code_format: \d{3}
344
344
  :branch_code_format: \d{4}
@@ -351,7 +351,7 @@ GT:
351
351
  :account_number_position: 9
352
352
  :account_number_length: 20
353
353
  :total_length: 28
354
- :iban_national_id_length: 4
354
+ :national_id_length: 4
355
355
  :bban_format: '[A-Z0-9]{4}[A-Z0-9]{20}'
356
356
  :bank_code_format: '[A-Z0-9]{4}'
357
357
  :account_number_format: '[A-Z0-9]{20}'
@@ -363,7 +363,7 @@ HR:
363
363
  :account_number_position: 12
364
364
  :account_number_length: 10
365
365
  :total_length: 21
366
- :iban_national_id_length: 7
366
+ :national_id_length: 7
367
367
  :bban_format: \d{7}\d{10}
368
368
  :bank_code_format: \d{7}
369
369
  :account_number_format: \d{10}
@@ -375,7 +375,7 @@ HU:
375
375
  :account_number_position: 12
376
376
  :account_number_length: 17
377
377
  :total_length: 28
378
- :iban_national_id_length: 7
378
+ :national_id_length: 7
379
379
  :bban_format: \d{3}\d{4}\d{1}\d{15}\d{1}
380
380
  :bank_code_format: \d{3}
381
381
  :branch_code_format: \d{4}
@@ -388,7 +388,7 @@ IE:
388
388
  :account_number_position: 15
389
389
  :account_number_length: 8
390
390
  :total_length: 22
391
- :iban_national_id_length: 10
391
+ :national_id_length: 10
392
392
  :bban_format: '[A-Z]{4}\d{6}\d{8}'
393
393
  :bank_code_format: '[A-Z]{4}'
394
394
  :branch_code_format: \d{6}
@@ -401,7 +401,7 @@ IL:
401
401
  :account_number_position: 11
402
402
  :account_number_length: 13
403
403
  :total_length: 23
404
- :iban_national_id_length: 6
404
+ :national_id_length: 6
405
405
  :bban_format: \d{3}\d{3}\d{13}
406
406
  :bank_code_format: \d{3}
407
407
  :branch_code_format: \d{3}
@@ -414,7 +414,7 @@ IS:
414
414
  :account_number_position: 9
415
415
  :account_number_length: 18
416
416
  :total_length: 26
417
- :iban_national_id_length: 4
417
+ :national_id_length: 4
418
418
  :bban_format: \d{4}\d{2}\d{6}\d{10}
419
419
  :bank_code_format: \d{4}
420
420
  :account_number_format: \d{2}\d{6}\d{10}
@@ -428,7 +428,7 @@ IT:
428
428
  :account_number_position: 16
429
429
  :account_number_length: 12
430
430
  :total_length: 27
431
- :iban_national_id_length: 10
431
+ :national_id_length: 10
432
432
  :bban_format: '[A-Z]{1}\d{5}\d{5}[A-Z0-9]{12}'
433
433
  :bank_code_format: \d{5}
434
434
  :branch_code_format: \d{5}
@@ -443,7 +443,7 @@ KW:
443
443
  :account_number_position: 9
444
444
  :account_number_length: 22
445
445
  :total_length: 30
446
- :iban_national_id_length: 4
446
+ :national_id_length: 4
447
447
  :bban_format: '[A-Z]{4}[A-Z0-9]{22}'
448
448
  :bank_code_format: '[A-Z]{4}'
449
449
  :account_number_format: '[A-Z0-9]{22}'
@@ -455,7 +455,7 @@ KZ:
455
455
  :account_number_position: 8
456
456
  :account_number_length: 13
457
457
  :total_length: 20
458
- :iban_national_id_length: 3
458
+ :national_id_length: 3
459
459
  :bban_format: \d{3}[A-Z0-9]{13}
460
460
  :bank_code_format: \d{3}
461
461
  :account_number_format: '[A-Z0-9]{13}'
@@ -467,7 +467,7 @@ LB:
467
467
  :account_number_position: 14
468
468
  :account_number_length: 14
469
469
  :total_length: 28
470
- :iban_national_id_length: 4
470
+ :national_id_length: 4
471
471
  :bban_format: \d{4}[A-Z0-9]{20}
472
472
  :bank_code_format: \d{4}
473
473
  :account_number_format: '[A-Z0-9]{14}'
@@ -479,7 +479,7 @@ LI:
479
479
  :account_number_position: 10
480
480
  :account_number_length: 12
481
481
  :total_length: 21
482
- :iban_national_id_length: 5
482
+ :national_id_length: 5
483
483
  :bban_format: \d{5}[A-Z0-9]{12}
484
484
  :bank_code_format: \d{5}
485
485
  :account_number_format: '[A-Z0-9]{12}'
@@ -491,7 +491,7 @@ LT:
491
491
  :account_number_position: 10
492
492
  :account_number_length: 11
493
493
  :total_length: 20
494
- :iban_national_id_length: 5
494
+ :national_id_length: 5
495
495
  :bban_format: \d{5}\d{11}
496
496
  :bank_code_format: \d{5}
497
497
  :account_number_format: \d{11}
@@ -503,7 +503,7 @@ LU:
503
503
  :account_number_position: 8
504
504
  :account_number_length: 13
505
505
  :total_length: 20
506
- :iban_national_id_length: 3
506
+ :national_id_length: 3
507
507
  :bban_format: \d{3}[A-Z0-9]{13}
508
508
  :bank_code_format: \d{3}
509
509
  :account_number_format: '[A-Z0-9]{13}'
@@ -515,7 +515,7 @@ LV:
515
515
  :account_number_position: 9
516
516
  :account_number_length: 13
517
517
  :total_length: 21
518
- :iban_national_id_length: 4
518
+ :national_id_length: 4
519
519
  :bban_format: '[A-Z]{4}[A-Z0-9]{13}'
520
520
  :bank_code_format: '[A-Z]{4}'
521
521
  :account_number_format: '[A-Z0-9]{13}'
@@ -527,7 +527,7 @@ MC:
527
527
  :account_number_position: 15
528
528
  :account_number_length: 13
529
529
  :total_length: 27
530
- :iban_national_id_length: 10
530
+ :national_id_length: 10
531
531
  :bban_format: \d{5}\d{5}[A-Z0-9]{11}\d{2}
532
532
  :bank_code_format: \d{5}
533
533
  :branch_code_format: \d{5}
@@ -542,7 +542,7 @@ MD:
542
542
  :account_number_position: 7
543
543
  :account_number_length: 18
544
544
  :total_length: 24
545
- :iban_national_id_length: 2
545
+ :national_id_length: 2
546
546
  :bban_format: '[A-Z0-9]{2}[A-Z0-9]{18}'
547
547
  :bank_code_format: '[A-Z0-9]{2}'
548
548
  :account_number_format: '[A-Z0-9]{18}'
@@ -554,7 +554,7 @@ ME:
554
554
  :account_number_position: 8
555
555
  :account_number_length: 15
556
556
  :total_length: 22
557
- :iban_national_id_length: 3
557
+ :national_id_length: 3
558
558
  :bban_format: \d{3}\d{13}\d{2}
559
559
  :bank_code_format: \d{3}
560
560
  :account_number_format: \d{13}\d{2}
@@ -566,7 +566,7 @@ MK:
566
566
  :account_number_position: 8
567
567
  :account_number_length: 12
568
568
  :total_length: 19
569
- :iban_national_id_length: 3
569
+ :national_id_length: 3
570
570
  :bban_format: \d{3}[A-Z0-9]{10}\d{2}
571
571
  :bank_code_format: \d{3}
572
572
  :account_number_format: '[A-Z0-9]{10}\d{2}'
@@ -578,7 +578,7 @@ MR:
578
578
  :account_number_position: 15
579
579
  :account_number_length: 13
580
580
  :total_length: 27
581
- :iban_national_id_length: 10
581
+ :national_id_length: 10
582
582
  :bban_format: \d{5}\d{5}\d{11}\d{2}
583
583
  :bank_code_format: \d{5}
584
584
  :branch_code_format: \d{5}
@@ -591,7 +591,7 @@ MT:
591
591
  :account_number_position: 14
592
592
  :account_number_length: 18
593
593
  :total_length: 31
594
- :iban_national_id_length: 9
594
+ :national_id_length: 9
595
595
  :bban_format: '[A-Z]{4}\d{5}[A-Z0-9]{18}'
596
596
  :bank_code_format: '[A-Z]{4}'
597
597
  :branch_code_format: \d{5}
@@ -604,7 +604,7 @@ MU:
604
604
  :account_number_position: 13
605
605
  :account_number_length: 18
606
606
  :total_length: 30
607
- :iban_national_id_length: 8
607
+ :national_id_length: 8
608
608
  :bban_format: '[A-Z]{4}\d{2}\d{2}\d{12}\d{3}[A-Z]{3}'
609
609
  :bank_code_format: '[A-Z]{4}\d{2}'
610
610
  :branch_code_format: \d{2}
@@ -617,7 +617,7 @@ NL:
617
617
  :account_number_position: 9
618
618
  :account_number_length: 10
619
619
  :total_length: 18
620
- :iban_national_id_length: 4
620
+ :national_id_length: 4
621
621
  :bban_format: '[A-Z]{4}\d{10}'
622
622
  :bank_code_format: '[A-Z]{4}'
623
623
  :account_number_format: \d{10}
@@ -631,7 +631,7 @@ NL:
631
631
  :account_number_position: 9
632
632
  :account_number_length: 7
633
633
  :total_length: 15
634
- :iban_national_id_length: 4
634
+ :national_id_length: 4
635
635
  :bban_format: \d{4}\d{6}\d{1}
636
636
  :bank_code_format: \d{4}
637
637
  :account_number_format: \d{6}\d{1}
@@ -645,7 +645,7 @@ PK:
645
645
  :account_number_position: 9
646
646
  :account_number_length: 16
647
647
  :total_length: 24
648
- :iban_national_id_length: 4
648
+ :national_id_length: 4
649
649
  :bban_format: '[A-Z]{4}[A-Z0-9]{16}'
650
650
  :bank_code_format: '[A-Z]{4}'
651
651
  :account_number_format: '[A-Z0-9]{16}'
@@ -657,7 +657,7 @@ PL:
657
657
  :account_number_position: 13
658
658
  :account_number_length: 16
659
659
  :total_length: 28
660
- :iban_national_id_length: 8
660
+ :national_id_length: 8
661
661
  :bban_format: \d{8}\d{16}
662
662
  :bank_code_format: \d{8}
663
663
  :account_number_format: \d{16}
@@ -669,7 +669,7 @@ PS:
669
669
  :account_number_position: 9
670
670
  :account_number_length: 21
671
671
  :total_length: 29
672
- :iban_national_id_length: 4
672
+ :national_id_length: 4
673
673
  :bban_format: '[A-Z]{4}[A-Z0-9]{21}'
674
674
  :bank_code_format: '4'
675
675
  :account_number_format: '}[A-Z0-9]{21}'
@@ -681,7 +681,7 @@ PT:
681
681
  :account_number_position: 13
682
682
  :account_number_length: 13
683
683
  :total_length: 25
684
- :iban_national_id_length: 4
684
+ :national_id_length: 4
685
685
  :bban_format: \d{4}\d{4}\d{11}\d{2}
686
686
  :bank_code_format: \d{4}
687
687
  :account_number_format: \d{11}\d{2}
@@ -696,7 +696,7 @@ RO:
696
696
  :account_number_position: 9
697
697
  :account_number_length: 16
698
698
  :total_length: 24
699
- :iban_national_id_length: 4
699
+ :national_id_length: 4
700
700
  :bban_format: '[A-Z]{4}[A-Z0-9]{16}'
701
701
  :bank_code_format: '[A-Z]{4}'
702
702
  :account_number_format: '[A-Z0-9]{16}'
@@ -708,7 +708,7 @@ RS:
708
708
  :account_number_position: 8
709
709
  :account_number_length: 15
710
710
  :total_length: 22
711
- :iban_national_id_length: 3
711
+ :national_id_length: 3
712
712
  :bban_format: \d{3}\d{13}\d{2}
713
713
  :bank_code_format: \d{3}
714
714
  :account_number_format: \d{13}\d{2}
@@ -720,7 +720,7 @@ SA:
720
720
  :account_number_position: 7
721
721
  :account_number_length: 18
722
722
  :total_length: 24
723
- :iban_national_id_length: 2
723
+ :national_id_length: 2
724
724
  :bban_format: \d{2}[A-Z0-9]{18}
725
725
  :bank_code_format: \d{2}
726
726
  :account_number_format: '[A-Z0-9]{18}'
@@ -732,7 +732,7 @@ SE:
732
732
  :account_number_position: 8
733
733
  :account_number_length: 17
734
734
  :total_length: 24
735
- :iban_national_id_length: 3
735
+ :national_id_length: 3
736
736
  :bban_format: \d{3}\d{16}\d{1}
737
737
  :bank_code_format: \d{3}
738
738
  :account_number_format: \d{16}\d{1}
@@ -747,7 +747,7 @@ SI:
747
747
  :account_number_position: 10
748
748
  :account_number_length: 10
749
749
  :total_length: 19
750
- :iban_national_id_length: 2
750
+ :national_id_length: 2
751
751
  :bban_format: \d{5}\d{8}\d{2}
752
752
  :bank_code_format: \d{5}
753
753
  :account_number_format: \d{8}\d{2}
@@ -759,7 +759,7 @@ SK:
759
759
  :account_number_position: 9
760
760
  :account_number_length: 16
761
761
  :total_length: 24
762
- :iban_national_id_length: 4
762
+ :national_id_length: 4
763
763
  :bban_format: \d{4}\d{6}\d{10}
764
764
  :bank_code_format: \d{4}
765
765
  :account_number_format: \d{6}\d{10}
@@ -773,7 +773,7 @@ SM:
773
773
  :account_number_position: 16
774
774
  :account_number_length: 12
775
775
  :total_length: 27
776
- :iban_national_id_length: 10
776
+ :national_id_length: 10
777
777
  :bban_format: '[A-Z]{1}\d{5}\d{5}[A-Z0-9]{12}'
778
778
  :bank_code_format: \d{5}
779
779
  :branch_code_format: \d{5}
@@ -788,7 +788,7 @@ TN:
788
788
  :account_number_position: 10
789
789
  :account_number_length: 15
790
790
  :total_length: 24
791
- :iban_national_id_length: 2
791
+ :national_id_length: 2
792
792
  :bban_format: \d{2}\d{3}\d{13}\d{2}
793
793
  :bank_code_format: \d{2}
794
794
  :branch_code_format: \d{3}
@@ -801,7 +801,7 @@ TR:
801
801
  :account_number_position: 10
802
802
  :account_number_length: 17
803
803
  :total_length: 26
804
- :iban_national_id_length: 5
804
+ :national_id_length: 5
805
805
  :bban_format: \d{5}[A-Z0-9]{1}[A-Z0-9]{16}
806
806
  :bank_code_format: \d{5}
807
807
  :account_number_format: '[A-Z0-9]{1}[A-Z0-9]{16}'
@@ -813,7 +813,7 @@ VG:
813
813
  :account_number_position: 9
814
814
  :account_number_length: 16
815
815
  :total_length: 24
816
- :iban_national_id_length: 4
816
+ :national_id_length: 4
817
817
  :bban_format: '[A-Z]{4}\d{16}'
818
818
  :bank_code_format: '[A-Z]{4}'
819
819
  :account_number_format: \d{16}
@@ -825,7 +825,7 @@ JO:
825
825
  :account_number_position: 9
826
826
  :account_number_length: 22
827
827
  :total_length: 30
828
- :iban_national_id_length: 4
828
+ :national_id_length: 4
829
829
  :bban_format: '[A-Z]{4}\d{4}[A-Z0-9]{18}'
830
830
  :bank_code_format: '[A-Z]{4}'
831
831
  :account_number_format: \d{4}[A-Z0-9]{18}
@@ -837,7 +837,7 @@ QA:
837
837
  :account_number_position: 9
838
838
  :account_number_length: 21
839
839
  :total_length: 29
840
- :iban_national_id_length: 4
840
+ :national_id_length: 4
841
841
  :bban_format: '[A-Z]{4}[A-Z0-9]{21}'
842
842
  :bank_code_format: '[A-Z]{4}'
843
843
  :account_number_format: '[A-Z0-9]{21}'
@@ -849,7 +849,7 @@ XK:
849
849
  :account_number_position: 5
850
850
  :account_number_length: 16
851
851
  :total_length: 20
852
- :iban_national_id_length: 4
852
+ :national_id_length: 4
853
853
  :bban_format: \d{4}\d{10}\d{2}
854
854
  :bank_code_format: \d{4}
855
855
  :account_number_format: \d{10}\d{2}
@@ -861,7 +861,7 @@ TL:
861
861
  :account_number_position: 8
862
862
  :account_number_length: 16
863
863
  :total_length: 23
864
- :iban_national_id_length: 3
864
+ :national_id_length: 3
865
865
  :bban_format: \d{3}\d{14}\d{2}
866
866
  :bank_code_format: \d{3}
867
867
  :account_number_format: ' \d{14} \d{2}'
data/lib/ibandit/iban.rb CHANGED
@@ -38,12 +38,12 @@ module Ibandit
38
38
  # Component parts #
39
39
  ###################
40
40
 
41
- def iban_national_id
41
+ def swift_national_id
42
42
  return unless decomposable?
43
43
 
44
44
  national_id = swift_bank_code.to_s
45
45
  national_id += swift_branch_code.to_s
46
- national_id.slice(0, structure[:iban_national_id_length])
46
+ national_id.slice(0, structure[:national_id_length])
47
47
  end
48
48
 
49
49
  def local_check_digits
@@ -1,3 +1,3 @@
1
1
  module Ibandit
2
- VERSION = '0.10.1'.freeze
2
+ VERSION = '0.11.0'.freeze
3
3
  end
@@ -52,7 +52,7 @@ describe Ibandit::IBAN do
52
52
  its(:swift_bank_code) { is_expected.to eq('WEST') }
53
53
  its(:swift_branch_code) { is_expected.to eq('123456') }
54
54
  its(:swift_account_number) { is_expected.to eq('98765432') }
55
- its(:iban_national_id) { is_expected.to eq('WEST123456') }
55
+ its(:swift_national_id) { is_expected.to eq('WEST123456') }
56
56
  its(:local_check_digits) { is_expected.to be_nil }
57
57
 
58
58
  context 'when the IBAN is blank' do
@@ -63,7 +63,7 @@ describe Ibandit::IBAN do
63
63
  its(:bank_code) { is_expected.to be_nil }
64
64
  its(:branch_code) { is_expected.to be_nil }
65
65
  its(:account_number) { is_expected.to be_nil }
66
- its(:iban_national_id) { is_expected.to be_nil }
66
+ its(:swift_national_id) { is_expected.to be_nil }
67
67
  its(:bban) { is_expected.to be_nil }
68
68
  its(:local_check_digits) { is_expected.to be_nil }
69
69
  end
@@ -79,7 +79,7 @@ describe Ibandit::IBAN do
79
79
  its(:swift_bank_code) { is_expected.to eq('800') }
80
80
  its(:swift_branch_code) { is_expected.to be_nil }
81
81
  its(:swift_account_number) { is_expected.to eq('00000075071211203') }
82
- its(:iban_national_id) { is_expected.to eq('800') }
82
+ its(:swift_national_id) { is_expected.to eq('800') }
83
83
  its(:local_check_digits) { is_expected.to be_nil }
84
84
  end
85
85
 
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.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grey Baker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-06 00:00:00.000000000 Z
11
+ date: 2016-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec