Module: FFaker::PhoneNumberIT

Extended by:
ModuleUtils, PhoneNumberIT
Included in:
PhoneNumberIT
Defined in:
lib/ffaker/phone_number_it.rb

Constant Summary collapse

COUNTRY_PREFIX =
['+39', '0039', '+39 ', '0039 '].freeze
PHONE_NUMBER =
['######', '########'].freeze

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, luhn_check, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#home_phone_numberObject



19
20
21
# File 'lib/ffaker/phone_number_it.rb', line 19

def home_phone_number
  number HOME_PHONE_PREFIXES
end

#mobile_phone_numberObject



23
24
25
# File 'lib/ffaker/phone_number_it.rb', line 23

def mobile_phone_number
  number MOBILE_PHONE_PREFIXES
end

#phone_numberObject



11
12
13
14
15
16
17
# File 'lib/ffaker/phone_number_it.rb', line 11

def phone_number
  if rand(0..1) == 1
    home_phone_number
  else
    mobile_phone_number
  end
end