module FFaker::PhoneNumberTW

def contry_code

def contry_code
  '+886'
end

def home_work_phone_number

def home_work_phone_number
  prefix = fetch_sample(HOME_PHONE_PREFIXES)
  case prefix
  when '02', '04'
    FFaker.numerify("(#{prefix}) ####-####")
  else
    FFaker.numerify("(#{prefix}) ###-####")
  end
end

def international_home_work_phone_number

def international_home_work_phone_number
  number = home_work_phone_number
  number[0..4] = "#{contry_code}-#{number[2]}-"
  number
end

def international_mobile_phone_number

def international_mobile_phone_number
  number = mobile_phone_number
  number[0] = "#{contry_code}-"
  number
end

def international_phone_number

def international_phone_number
  rand(0..1).zero? ? international_mobile_phone_number : international_home_work_phone_number
end

def mobile_phone_number

def mobile_phone_number
  FFaker.numerify("#{MOBILE_PHONE_PREFIX}##-###-###")
end

def phone_number

def phone_number
  rand(0..1).zero? ? home_work_phone_number : mobile_phone_number
end