module FFaker::Bank
def check_country_existence(country_code)
def check_country_existence(country_code) unless COUNTRIES.keys.include?(country_code.upcase) raise ArgumentError, "Unexpected country code: '#{country_code}'" end end
def formatify_iban(code)
def formatify_iban(code) FFaker.bothify(code).upcase end
def iban(country_code: nil)
def iban(country_code: nil) return formatify_iban(fetch_sample(COUNTRIES.values)) unless country_code check_country_existence(country_code) formatify_iban(COUNTRIES[country_code.upcase]) end