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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c562e97a04982ee523d2601adbcdb38221e6248
4
- data.tar.gz: 5cd4d0a92482a156efd5123f3e8358e75ae1d84b
3
+ metadata.gz: 7e56d8fc819f2691e9f2e158da35e1b90e7c51a1
4
+ data.tar.gz: 2751629d86dbd57e238a6d4657588aa2873df4c6
5
5
  SHA512:
6
- metadata.gz: 551e9feff006ea6a96917a29dc179fde9db4a8ee87b0e10b3d3a630edf9105c7e06f875468b7fa0f222f0a368a09c2f29c22232166aa0b6f21345d3400eabdb1
7
- data.tar.gz: 8611a23668c2d5d04183b8a61c64d51e6caaf62a6d9d0f325f9d2076a596e363b7b4f6a94ba7f909da6a213f8f9f6fc0cee66acc095c87334334972fd7b44aeb
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
- iban.to_local => {bank_code: '37040044', account_number: '532013000'} => standarmässig ohne führende Null
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
- iban.to_local**(false)** => {:bank_code=>"2100", :branch_code=>"0418", :check_digits=>"45", :account_number=>"02000513"} => mit führende Nullen
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
- ### erroors
51
- iban.errors => liefert ein array mit den möglichen Fehlern
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
- ## Constants/Initits
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, ignore_zero = true)
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 ignore_zero
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
@@ -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(ignore_zero=true)
65
- Conversion.iban2local country_code, bban, ignore_zero
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
@@ -1,3 +1,3 @@
1
1
  module Ibanvalidator
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibanvalidator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olaf Kaderka