Module: Faker::PhoneNumberMX
- Extended by:
- ModuleUtils, PhoneNumberMX
- Included in:
- PhoneNumberMX
- Defined in:
- lib/ffakerer/phone_number_mx.rb
Overview
Author: guapolo github.com/guapolo
Instance Method Summary collapse
- #country_code ⇒ Object
-
#home_work_phone_number ⇒ Object
Generates a general phone number xx xxxx xxxx.
- #international_home_work_phone_number ⇒ Object
- #international_mobile_phone_number ⇒ Object
- #international_phone_number ⇒ Object
-
#mobile_phone_number ⇒ Object
Generates a mobile phone number 044 xx xxxx xxxx.
-
#phone_number ⇒ Object
generates mobile or home/work number.
-
#toll_free_number ⇒ Object
Generates a toll-free number 01 800 xxx xxxx.
Methods included from ModuleUtils
Instance Method Details
#country_code ⇒ Object
31 32 33 |
# File 'lib/ffakerer/phone_number_mx.rb', line 31 def country_code "+52" end |
#home_work_phone_number ⇒ Object
Generates a general phone number
xx xxxx xxxx
12 13 14 |
# File 'lib/ffakerer/phone_number_mx.rb', line 12 def home_work_phone_number Faker.numerify("## #### ####") end |
#international_home_work_phone_number ⇒ Object
39 40 41 |
# File 'lib/ffakerer/phone_number_mx.rb', line 39 def international_home_work_phone_number Faker.numerify("#{country_code} ## #### ####") end |
#international_mobile_phone_number ⇒ Object
35 36 37 |
# File 'lib/ffakerer/phone_number_mx.rb', line 35 def international_mobile_phone_number Faker.numerify("#{country_code} 1 ## #### ####") end |
#international_phone_number ⇒ Object
43 44 45 46 47 48 |
# File 'lib/ffakerer/phone_number_mx.rb', line 43 def international_phone_number case rand(2) when 0 then international_mobile_phone_number when 1 then international_home_work_phone_number end end |
#mobile_phone_number ⇒ Object
Generates a mobile phone number 044 xx xxxx xxxx
19 20 21 |
# File 'lib/ffakerer/phone_number_mx.rb', line 19 def mobile_phone_number Faker.numerify("044 ## #### ####") end |
#phone_number ⇒ Object
generates mobile or home/work number
24 25 26 27 28 29 |
# File 'lib/ffakerer/phone_number_mx.rb', line 24 def phone_number case rand(2) when 0 then home_work_phone_number when 1 then mobile_phone_number end end |