ibanvalidator 0.2.1 → 0.2.2
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 +4 -4
- data/README.md +12 -6
- data/lib/ibanvalidator/conversion.rb +2 -2
- data/lib/ibanvalidator/iban.rb +2 -2
- data/lib/ibanvalidator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e56d8fc819f2691e9f2e158da35e1b90e7c51a1
|
4
|
+
data.tar.gz: 2751629d86dbd57e238a6d4657588aa2873df4c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed2f69f91c59e09edc36892cfe1761fd86f9f46d71e9679de99504567fc42841a1448f5ce86e3a27f624b6721771547c8e21d675cab4d4c52ea44b6742d0a889
|
7
|
+
data.tar.gz: b56b72c0340b3a72d3159b66f5e91c794a51c21f048a3fcd43efb0b675c1ff413a15e033650679a538071b94f32ed004fcc5af18c7b5d5f0e204fa0f61eecbf9
|
data/README.md
CHANGED
@@ -40,20 +40,26 @@ Or install it yourself as:
|
|
40
40
|
iban.prettify => "DE89 3704 0044 0532 0130 00"
|
41
41
|
iban.sepa_scheme? => true
|
42
42
|
|
43
|
-
|
43
|
+
## converting iban => to_local
|
44
|
+
iban = Ibanvalidator::IBAN.new("DE89370 40044053201 3000")
|
45
|
+
iban.to_local => {bank_code: '37040044', account_number: '532013000'}
|
44
46
|
|
47
|
+
Steuerung der Ausgabe der führenden Nullen (Leading Zero true/false , standard => false)
|
48
|
+
|
45
49
|
iban = Ibanvalidator::IBAN.new("ES9121000418450200051332")
|
46
|
-
iban.to_local => {:bank_code=>"2100", :branch_code=>"418", :check_digits=>"45", :account_number=>"2000513"} => ohne führende Nullen
|
47
|
-
|
50
|
+
iban.to_local => {:bank_code=>"2100", :branch_code=>"418", :check_digits=>"45", :account_number=>"2000513"} => ohne führende Nullen, leading_zero = false
|
51
|
+
|
52
|
+
mit führenden Nullen / Leading Zero:
|
53
|
+
iban.to_local(true) => {:bank_code=>"2100", :branch_code=>"0418", :check_digits=>"45", :account_number=>"02000513"} => mit führende Nullen, leading_zero = true
|
48
54
|
|
49
55
|
|
50
|
-
###
|
51
|
-
iban.errors =>
|
56
|
+
### errors
|
57
|
+
iban.errors => [] => Array mit den möglichen Fehlern
|
52
58
|
* :iban_too_short, :iban_too_short, :iban_bad_chars => sind grundsätzliche Fehler
|
53
59
|
* :iban_unknown_country_code, :iban_bad_length, :iban_bad_format, :iban_bad_check_digits => sind Regel-Fehler (also landesspezifisch)
|
54
60
|
|
55
61
|
|
56
|
-
##
|
62
|
+
## Konstants/Inits
|
57
63
|
|
58
64
|
**Ibanvalidator.default_rules** => liefert alle IBAN Regeln
|
59
65
|
|
@@ -22,7 +22,7 @@ module Ibanvalidator
|
|
22
22
|
end
|
23
23
|
|
24
24
|
|
25
|
-
def self.iban2local(country_code, bban,
|
25
|
+
def self.iban2local(country_code, bban, leading_zero = false)
|
26
26
|
config = load_config country_code
|
27
27
|
|
28
28
|
|
@@ -36,7 +36,7 @@ module Ibanvalidator
|
|
36
36
|
ret
|
37
37
|
end.join('')
|
38
38
|
#entefernen von führenden nullen
|
39
|
-
local[key.to_sym].sub!(/^0+/, '') if
|
39
|
+
local[key.to_sym].sub!(/^0+/, '') if !leading_zero
|
40
40
|
local[key.to_sym] = '0' if local[key.to_sym] == ''
|
41
41
|
end
|
42
42
|
local
|
data/lib/ibanvalidator/iban.rb
CHANGED
@@ -61,8 +61,8 @@ module Ibanvalidator
|
|
61
61
|
end
|
62
62
|
|
63
63
|
#mit ignore_zero fasle werdnen die führenden nullen mit ausgegeben
|
64
|
-
def to_local(
|
65
|
-
Conversion.iban2local country_code, bban,
|
64
|
+
def to_local(leading_zero=false)
|
65
|
+
Conversion.iban2local country_code, bban, leading_zero
|
66
66
|
end
|
67
67
|
|
68
68
|
def to_s
|