module FFaker::Bank
Constants
- COUNTRIES
Public Instance Methods
Source
# File lib/ffaker/bank.rb, line 98 def card_expiry_date(year_range: 5, year_latest: -5, format: '%m/%y') FFaker::Time.date({ year_range: year_range, year_latest: year_latest }).strftime(format) end
Source
# File lib/ffaker/bank.rb, line 94 def card_number FFaker.numerify('#### #### #### ####') end
Source
# File lib/ffaker/bank.rb, line 87 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
Private Instance Methods
Source
# File lib/ffaker/bank.rb, line 112 def check_country_existence(country_code) return if COUNTRIES.key?(country_code.upcase) raise ArgumentError, "Unexpected country code: '#{country_code}'" end
Source
# File lib/ffaker/bank.rb, line 108 def formatify_iban(code) FFaker.bothify(code).upcase end