Skip to content

Commit

Permalink
normalized_bank_name function
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii.buk committed Jan 20, 2025
1 parent 7d26fd7 commit 8eb07f6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/umbrellio_utils/misc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,14 @@ def reset_defaults_for_hash(hash)
end
end
end

def normalized_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

0 comments on commit 8eb07f6

Please sign in to comment.