Skip to content

Commit 580e834

Browse files
author
dmitrii.buk
committed
normalized_bank_name function
1 parent 7d26fd7 commit 580e834

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

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

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)