lib/ibandit/local_details_cleaner.rb in ibandit-0.8.7 vs lib/ibandit/local_details_cleaner.rb in ibandit-0.8.8
- old
+ new
@@ -189,12 +189,13 @@
# This method supports being passed the component IBAN parts, as defined
# by SWIFT, or a single 20 digit string.
if local_details[:bank_code] && local_details[:branch_code]
bank_code = local_details[:bank_code]
branch_code = local_details[:branch_code]
- account_number = local_details[:account_number]
+ account_number = local_details[:account_number].gsub(/[-\s]/, '')
else
- cleaned_account_number = local_details[:account_number].tr('-', '')
+ cleaned_account_number =
+ local_details[:account_number].gsub(/[-\s]/, '')
bank_code = cleaned_account_number.slice(0, 4)
branch_code = cleaned_account_number.slice(4, 4)
account_number = cleaned_account_number[8..-1]
end