Skip to content

Commit c2516eb

Browse files
authored
normalize_bank_name function (#36)
1 parent 7d26fd7 commit c2516eb

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

Diff for: Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
umbrellio-utils (1.5.5)
4+
umbrellio-utils (1.6.0)
55
memery (~> 1)
66

77
GEM

Diff for: lib/umbrellio_utils/misc.rb

+10
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,15 @@ def reset_defaults_for_hash(hash)
6363
end
6464
end
6565
end
66+
67+
# needs any_ascii gem to work
68+
def normalize_bank_name(name)
69+
result = AnyAscii.transliterate(name).gsub(/[^A-Za-z0-9]+/, " ").upcase.squish
70+
result.sub!(/\ATHE\s+/, "")
71+
result.sub!(/\bLIMITED\b/, "LTD")
72+
result.sub!(/\bCOMPANY\b/, "CO")
73+
result.sub!(/\bCORPORATION\b/, "CORP")
74+
result
75+
end
6676
end
6777
end

Diff for: lib/umbrellio_utils/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module UmbrellioUtils
4-
VERSION = "1.5.5"
4+
VERSION = "1.6.0"
55
end

0 commit comments

Comments
 (0)