Class: Ibandit::GermanDetailsConverter::Rule004201

Inherits:
Rule004200 show all
Defined in:
lib/ibandit/german_details_converter.rb

Overview

New version of Rule004200 but with another range: For 10-digit Account Numbers, only the following Account Numbers are applicable to be issued / created into an IBAN with the standard-IBAN rule: nnn4400001 to nnn4499999

Instance Method Summary collapse

Methods inherited from BaseRule

#initialize

Constructor Details

This class inherits a constructor from Ibandit::GermanDetailsConverter::BaseRule

Instance Method Details

#converted_detailsObject



967
968
969
970
971
972
973
974
975
976
# File 'lib/ibandit/german_details_converter.rb', line 967

def converted_details
   = @account_number.gsub(/\A0+/, "")

  if .size == 10 &&
      %w[4400001 4499999].include?(.slice(3, 10))
    { bank_code: @bank_code, account_number: @account_number }
  else
    super
  end
end