Module: FFaker::PhoneNumberID
Constant Summary
collapse
- COUNTRY_CODE =
'+62'
Instance Method Summary
collapse
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Instance Method Details
#home_phone_number ⇒ Object
14
15
16
17
18
|
# File 'lib/ffaker/phone_number_id.rb', line 14
def home_phone_number
digit_nums = '#' * rand(7..8)
"#{fetch_sample(HOME_PHONE_PREFIXES)}-#{FFaker.numerify(digit_nums)}"
end
|
#international_home_phone_number ⇒ Object
28
29
30
|
# File 'lib/ffaker/phone_number_id.rb', line 28
def international_home_phone_number
home_phone_number.sub('0', COUNTRY_CODE)
end
|
#international_mobile_phone_number ⇒ Object
24
25
26
|
# File 'lib/ffaker/phone_number_id.rb', line 24
def international_mobile_phone_number
mobile_phone_number.sub('0', COUNTRY_CODE)
end
|
#international_phone_number ⇒ Object
32
33
34
|
# File 'lib/ffaker/phone_number_id.rb', line 32
def international_phone_number
phone_number.sub('0', COUNTRY_CODE)
end
|
#mobile_phone_number ⇒ Object
10
11
12
|
# File 'lib/ffaker/phone_number_id.rb', line 10
def mobile_phone_number
"#{fetch_sample(MOBILE_PHONE_PREFIXES)}-#{FFaker.numerify('########')}"
end
|
#phone_number ⇒ Object
20
21
22
|
# File 'lib/ffaker/phone_number_id.rb', line 20
def phone_number
rand(0..1).zero? ? home_phone_number : mobile_phone_number
end
|