Skip to content

Commit

Permalink
normalize_bank_name function (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmi3-bu authored Jan 21, 2025
1 parent 7d26fd7 commit c2516eb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
umbrellio-utils (1.5.5)
umbrellio-utils (1.6.0)
memery (~> 1)

GEM
Expand Down
10 changes: 10 additions & 0 deletions lib/umbrellio_utils/misc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,15 @@ def reset_defaults_for_hash(hash)
end
end
end

# needs any_ascii gem to work
def normalize_bank_name(name)
result = AnyAscii.transliterate(name).gsub(/[^A-Za-z0-9]+/, " ").upcase.squish
result.sub!(/\ATHE\s+/, "")
result.sub!(/\bLIMITED\b/, "LTD")
result.sub!(/\bCOMPANY\b/, "CO")
result.sub!(/\bCORPORATION\b/, "CORP")
result
end
end
end
2 changes: 1 addition & 1 deletion lib/umbrellio_utils/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module UmbrellioUtils
VERSION = "1.5.5"
VERSION = "1.6.0"
end

0 comments on commit c2516eb

Please sign in to comment.