Class: Faker::Bank
Constant Summary
Constants inherited
from Base
Faker::Base::Letters, Faker::Base::Numbers, Faker::Base::ULetters
Class Method Summary
collapse
Methods inherited from Base
bothify, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, respond_to_missing?, sample, shuffle, translate, unique, with_locale
Class Method Details
.account_number(digits = 11) ⇒ Object
6
7
8
|
# File 'lib/faker/bank.rb', line 6
def account_number(digits = 11)
rand.to_s[2..digits]
end
|
.iban(country_code = 'GB') ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/faker/bank.rb', line 10
def iban(country_code = 'GB')
begin
pattern = fetch("bank.iban_details.#{country_code.downcase}.bban_pattern")
rescue I18n::MissingTranslationData
raise ArgumentError, "Could not find iban details for #{country_code}"
end
account = Base.regexify(/#{pattern}/)
country_code.upcase + iban_checksum(country_code, account) + account
end
|
.name ⇒ Object
27
28
29
|
# File 'lib/faker/bank.rb', line 27
def name
fetch('bank.name')
end
|
.routing_number ⇒ Object
31
32
33
|
# File 'lib/faker/bank.rb', line 31
def routing_number
valid_routing_number
end
|
35
36
37
|
# File 'lib/faker/bank.rb', line 35
def routing_number_with_format
compile_fraction(valid_routing_number)
end
|
.swift_bic ⇒ Object
39
40
41
|
# File 'lib/faker/bank.rb', line 39
def swift_bic
fetch('bank.swift_bic')
end
|