module FFaker::PhoneNumberFR

def country_code

def country_code
  "#{fetch_sample(['+', '00'])}#{COUNTRY_CODE}"
end

def home_work_phone_number

def home_work_phone_number
  number HOME_WORK_PHONE_PREFIX
end

def international_home_work_phone_number

def international_home_work_phone_number
  number HOME_WORK_PHONE_PREFIX, country_code
end

def international_mobile_phone_number

def international_mobile_phone_number
  number MOBILE_PHONE_PREFIX, country_code
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
  number MOBILE_PHONE_PREFIX
end

def number(prefixes, country_prefix = '')

def number(prefixes, country_prefix = '')
  space  = random_space
  prefix = fetch_sample(prefixes)
  prefix = prefix[1] unless country_prefix == ''
  FFaker.numerify [
    country_prefix,
    space,
    prefix,
    fetch_sample(PHONE_NUMBER)
  ].join.strip
end

def phone_number

generates mobile or home/work number
def phone_number
  rand(0..1).zero? ? home_work_phone_number : mobile_phone_number
end

def random_space

def random_space
  rand(0..1).zero? ? '' : ' '
end