Module: FFaker::PhoneNumberMX

Extended by:
ModuleUtils, PhoneNumberMX
Included in:
PhoneNumberMX
Defined in:
lib/ffaker/phone_number_mx.rb

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#country_codeObject


30
31
32
# File 'lib/ffaker/phone_number_mx.rb', line 30

def country_code
  '+52'
end

#home_work_phone_numberObject

Generates a general phone number

xx xxxx xxxx

11
12
13
# File 'lib/ffaker/phone_number_mx.rb', line 11

def home_work_phone_number
  FFaker.numerify('## #### ####')
end

#international_home_work_phone_numberObject


38
39
40
# File 'lib/ffaker/phone_number_mx.rb', line 38

def international_home_work_phone_number
  FFaker.numerify("#{country_code} ## #### ####")
end

#international_mobile_phone_numberObject


34
35
36
# File 'lib/ffaker/phone_number_mx.rb', line 34

def international_mobile_phone_number
  FFaker.numerify("#{country_code} 1 ## #### ####")
end

#international_phone_numberObject


42
43
44
45
46
47
# File 'lib/ffaker/phone_number_mx.rb', line 42

def international_phone_number
  case rand(0..1)
  when 0 then international_mobile_phone_number
  when 1 then international_home_work_phone_number
  end
end

#mobile_phone_numberObject

Generates a mobile phone number 044 xx xxxx xxxx


18
19
20
# File 'lib/ffaker/phone_number_mx.rb', line 18

def mobile_phone_number
  FFaker.numerify('044 ## #### ####')
end

#phone_numberObject

generates mobile or home/work number


23
24
25
26
27
28
# File 'lib/ffaker/phone_number_mx.rb', line 23

def phone_number
  case rand(0..1)
  when 0 then home_work_phone_number
  when 1 then mobile_phone_number
  end
end

#toll_free_numberObject

Generates a toll-free number

01 800 xxx xxxx

52
53
54
# File 'lib/ffaker/phone_number_mx.rb', line 52

def toll_free_number
  FFaker.numerify('01 800 ### ####')
end