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