banktools-gb 0.4.0 → 0.5.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: e62708dc1891a4ffa3ff2cd58a02e3fb4f5eaa9d
4
- data.tar.gz: 408c21b0d050f697b137090a1b291b948a6f0648
3
+ metadata.gz: c0f3e7f61bc8d6f56034536be0c064e6cf1f7d18
4
+ data.tar.gz: bb3a03b154524de3daed3de0d75513236b4541c8
5
5
  SHA512:
6
- metadata.gz: d5910eeb5b48f599ecd3e2a964a7cc9741cad0bcaefcee22c85d7e6b5e49f733239a2923f9d04118c0dd1c8d4a84e23b7399f89ff5ca70ce5cedcfd8ceadd933
7
- data.tar.gz: 040d89b34757aa5c4f8c86a9a3f71c487a697dd6233d46085f975e4d8b8d0ed5b50576b0762eb359a885250b0f53e27426057e573666bb8940ff5ebe4f4c0557
6
+ metadata.gz: 9a57461e8877d93410799c501e87d06cd995d9c92519f29731d3fdcef79c3450d43a0b23f2f4a0d8a149d5d7f9248ee711b15f7731de935855d51372abbf470a
7
+ data.tar.gz: f7e80fe6f3758b54ab86cd6f452172537fa0f684517313cce0b619a8b84b40e68824b1a201a6295695c8f7a46487dc14e5a320e5d5ac4ace2f909f4759b9e160
data/README.md CHANGED
@@ -14,15 +14,16 @@ If we got anything wrong, please file an issue or contribute a fix yourself.
14
14
 
15
15
  bad_account = BankTools::GB::AccountNumberWithSortCode.new(account_number: "1", sort_code: "")
16
16
  bad_account.valid? # => false
17
- bad_account.errors # => [:account_numberaccount_number_too_short]
17
+ bad_account.errors # => [:account_number_is_too_short]
18
18
 
19
19
  # Error codes
20
20
 
21
- BankTools::GB::Errors::ACCOUNT_NUMBER_TOO_SHORT # => :account_number_too_short
22
- BankTools::GB::Errors::ACCOUNT_NUMBER_TOO_LONG # => :account_number_too_long
23
- BankTools::GB::Errors::SORT_CODE_WITH_WRONG_LENGTH # => :sort_code_with_wrong_length
24
- BankTools::GB::Errors::ACCOUNT_NUMBER_INVALID_CHARACTERS # => :account_number_invalid_characters
25
- BankTools::GB::Errors::SORT_CODE_INVALID_CHARACTERS # => :sort_code_invalid_characters
21
+ BankTools::GB::Errors::ACCOUNT_NUMBER_IS_TOO_SHORT # => :account_number_is_too_short
22
+ BankTools::GB::Errors::ACCOUNT_NUMBER_IS_TOO_LONG # => :account_number_is_too_long
23
+ BankTools::GB::Errors::SORT_CODE_WITH_WRONG_LENGTH # => :sort_code_with_wrong_length
24
+ BankTools::GB::Errors::ACCOUNT_NUMBER_WITH_INVALID_CHARACTERS # => :account_number_with_invalid_characters
25
+ BankTools::GB::Errors::SORT_CODE_WITH_INVALID_CHARACTERS # => :sort_code_with_invalid_characters
26
+ BankTools::GB::Errors::ACCOUNT_NUMBER_DOES_NOT_MATCH_SORT_CODE # => :account_number_does_not_match_sort_code
26
27
 
27
28
  ## Installation
28
29
 
@@ -18,11 +18,11 @@ module BankTools
18
18
 
19
19
  def errors
20
20
  errors = []
21
- errors << :account_number_too_short if account_number_too_short?
22
- errors << :account_number_too_long if account_number_too_long?
21
+ errors << :account_number_is_too_short if account_number_is_too_short?
22
+ errors << :account_number_is_too_long if account_number_is_too_long?
23
23
  errors << :sort_code_with_wrong_length if sort_code_with_wrong_length?
24
- errors << :sort_code_invalid_characters if any_non_digits?(compact_sort_code)
25
- errors << :account_number_invalid_characters if any_non_digits?(compact_account_number)
24
+ errors << :sort_code_with_invalid_characters if any_non_digits?(compact_sort_code)
25
+ errors << :account_number_with_invalid_characters if any_non_digits?(compact_account_number)
26
26
  errors << :account_number_does_not_match_sort_code unless valid_account_number_with_sort_code?
27
27
  errors
28
28
  end
@@ -37,11 +37,11 @@ module BankTools
37
37
  compact_sort_code.length != SORT_CODE_LENGTH
38
38
  end
39
39
 
40
- def account_number_too_short?
40
+ def account_number_is_too_short?
41
41
  compact_account_number.length < ACCOUNT_NUMBER_MIN_LENGTH
42
42
  end
43
43
 
44
- def account_number_too_long?
44
+ def account_number_is_too_long?
45
45
  compact_account_number.length > ACCOUNT_NUMBER_MAX_LENGTH
46
46
  end
47
47
 
@@ -1,11 +1,11 @@
1
1
  module Banktools
2
2
  module GB
3
3
  module Errors
4
- ACCOUNT_NUMBER_TOO_SHORT = :account_number_too_short
5
- ACCOUNT_NUMBER_TOO_LONG = :account_number_too_long
4
+ ACCOUNT_NUMBER_IS_TOO_SHORT = :account_number_is_too_short
5
+ ACCOUNT_NUMBER_IS_TOO_LONG = :account_number_is_too_long
6
6
  SORT_CODE_WITH_WRONG_LENGTH = :sort_code_with_wrong_length
7
- SORT_CODE_INVALID_CHARACTERS = :sort_code_invalid_characters
8
- ACCOUNT_NUMBER_INVALID_CHARACTERS = :account_number_invalid_characters
7
+ SORT_CODE_WITH_INVALID_CHARACTERS = :sort_code_with_invalid_characters
8
+ ACCOUNT_NUMBER_WITH_INVALID_CHARACTERS = :account_number_with_invalid_characters
9
9
  ACCOUNT_NUMBER_DOES_NOT_MATCH_SORT_CODE = :account_number_does_not_match_sort_code
10
10
  end
11
11
  end
@@ -1,5 +1,5 @@
1
1
  module Banktools
2
2
  module Gb
3
- VERSION = "0.4.0"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: banktools-gb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Skogberg