Module: FFaker::PhoneNumberKR
Constant Summary
collapse
- HOME_PHONE_PREFIXES =
%w[02 031 032 033 041 042 043 044 049 051 052 053 054 055 061 062 063 064].freeze
- MOBILE_PHONE_PREFIXES =
%w[010 011 016 019].freeze
Instance Method Summary
collapse
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Instance Method Details
#contry_code ⇒ Object
27
28
29
|
# File 'lib/ffaker/phone_number_kr.rb', line 27
def contry_code
'+82'
end
|
#home_work_phone_number ⇒ Object
#international_home_work_phone_number ⇒ Object
37
38
39
40
41
|
# File 'lib/ffaker/phone_number_kr.rb', line 37
def international_home_work_phone_number
number = home_work_phone_number
number[0] = "#{contry_code} "
number
end
|
#international_mobile_phone_number ⇒ Object
31
32
33
34
35
|
# File 'lib/ffaker/phone_number_kr.rb', line 31
def international_mobile_phone_number
number = mobile_phone_number
number[0] = "#{contry_code} "
number
end
|
#international_phone_number ⇒ Object
43
44
45
46
47
48
|
# File 'lib/ffaker/phone_number_kr.rb', line 43
def international_phone_number
case rand(0..1)
when 0 then international_mobile_phone_number
when 1 then international_home_work_phone_number
end
end
|
#mobile_phone_number ⇒ Object
#phone_number ⇒ Object
12
13
14
15
16
17
|
# File 'lib/ffaker/phone_number_kr.rb', line 12
def phone_number
case rand(0..1)
when 0 then home_work_phone_number
when 1 then mobile_phone_number
end
end
|