module Faker::PhoneNumberSN
def homework_number
Example 33 906 29 05
Example 33 945 07 00
Example 33 845 77 99
Generates a home or work phone number
def homework_number "#{homework_phone_prefix}-#{[8, 9][rand(1)]}#{Faker.numerify('##-##-##')}" end
def homework_phone_prefix
- See: Faker::PhoneNumberSN::HomeWorkOperatorsPrefix -
def homework_phone_prefix HomeWorkOperatorsPrefix[0] end
def mobile_number
Example 77 726 29 05
Example 76 245 07 00
Example 70 745 77 99
Generates a mobile phone number
def mobile_number "#{mobile_phone_prefix}-#{short_phone_number}" end
def mobile_phone_prefix
- See: Faker::PhoneNumberSN::MobileOperatorsPrefix -
def mobile_phone_prefix MobileOperatorsPrefix[rand(3)] end
def phone_number
Generates a random phone number mobile or home or work
def phone_number case rand(10) when 0 then homework_number when 9 then homework_number when 3 then mobile_number when 5 then mobile_number when 6 then mobile_number when 8 then mobile_number else homework_number end end
def short_phone_number
Example 726 29 05
Example 245 07 00
Example 745 77 99
Pattern that can be combined with a prefix to generate mobile, office phone_numbers
def short_phone_number Faker.numerify('###-##-##') end