Module: FFaker::BankUS

Extended by:
BankUS, ModuleUtils
Included in:
BankUS
Defined in:
lib/ffaker/bank_us.rb

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, luhn_check, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#account_number(min_digits: 9, max_digits: 17) ⇒ Object



8
9
10
# File 'lib/ffaker/bank_us.rb', line 8

def (min_digits: 9, max_digits: 17)
  FFaker.numerify('#' * rand(min_digits..max_digits))
end

#routing_numberObject



12
13
14
15
16
17
# File 'lib/ffaker/bank_us.rb', line 12

def routing_number
  partial_routing_number = FFaker.numerify('########')
  ninth_digit = generate_ninth_digit(partial_routing_number)

  "#{partial_routing_number}#{ninth_digit}"
end