module FFaker::PhoneNumberJA
def home_phone_number
def home_phone_number disit = rand(1..4) FFaker.numerify("#{JAPAN_PREFIX}#{home_phone_number_format(disit)}") end
def home_phone_number_format(disit)
def home_phone_number_format(disit) prefix = home_phone_prefix(disit) select_home_phone_format(disit) % prefix end
def home_phone_prefix(disit = nil)
def home_phone_prefix(disit = nil) case disit when 1 then fetch_sample(ONE_DISIT_AREA_CODES) when 2 then fetch_sample(TWO_DISIT_AREA_CODES) when 3 then fetch_sample(THREE_DISIT_AREA_CODES) when 4 then fetch_sample(FOUR_DISIT_AREA_CODES) end end
def international_home_phone_number
def international_home_phone_number disit = rand(1..4) FFaker.numerify("#{JAPAN_COUNTRY_CODE} #{home_phone_number_format(disit)}") end
def international_mobile_phone_number
def international_mobile_phone_number FFaker.numerify("#{JAPAN_COUNTRY_CODE} #{mobile_phone_number_format}") end
def international_phone_number
def international_phone_number case rand(0..1) when 0 then international_mobile_phone_number when 1 then international_home_phone_number end end
def mobile_phone_number
def mobile_phone_number FFaker.numerify("#{JAPAN_PREFIX}#{mobile_phone_number_format}") end
def mobile_phone_number_format
def mobile_phone_number_format prefix = mobile_prefix MOBILE_NUMBER_FORMAT % prefix end
def mobile_prefix
def mobile_prefix fetch_sample(MOBILE_PHONE_PREFIXES) end
def phone_number
def phone_number case rand(0..1) when 0 then home_phone_number when 1 then mobile_phone_number end end
def select_home_phone_format(disit)
def select_home_phone_format(disit) case disit when 1 then ONE_DISIT_FORMAT when 2 then TWO_DISIT_FORMAT when 3 then THREE_DISIT_FORMAT when 4 then FOUR_DISIT_FORMAT end end