Module: Faker::PhoneNumberSG
- Extended by:
- ModuleUtils, PhoneNumberSG
- Included in:
- PhoneNumberSG
- Defined in:
- lib/ffakerer/phone_number_sg.rb
Overview
Based on information from en.wikipedia.org/wiki/Telephone_numbers_in_Singapore
Instance Method Summary collapse
- #country_code ⇒ Object
-
#fixed_line_number ⇒ Object
Generates a fixed line phone number 6xxx xxxx.
-
#international_toll_free_number ⇒ Object
Generates an international toll-free number 800 xxx xxxx.
-
#mobile_number ⇒ Object
Generates a fixed mobile phone number 8xxx xxxx.
-
#mobile_or_pager_number ⇒ Object
Generates a fixed mobile phone number or pager service number 9xxx xxxx.
-
#phone_number ⇒ Object
generates mobile or home/work number.
-
#premium_service_number ⇒ Object
Generates a premium service number (1900) xxx xxxx.
-
#toll_free_number ⇒ Object
Generates an toll-free number 1800 xxx xxxx.
-
#voip_number ⇒ Object
Generates a voip phone number 3xxx xxxx.
Methods included from ModuleUtils
Instance Method Details
#country_code ⇒ Object
77 78 79 |
# File 'lib/ffakerer/phone_number_sg.rb', line 77 def country_code "+65" end |
#fixed_line_number ⇒ Object
Generates a fixed line phone number
6xxx xxxx
29 30 31 |
# File 'lib/ffakerer/phone_number_sg.rb', line 29 def fixed_line_number Faker.numerify("6### ####") end |
#international_toll_free_number ⇒ Object
Generates an international toll-free number
800 xxx xxxx
50 51 52 |
# File 'lib/ffakerer/phone_number_sg.rb', line 50 def international_toll_free_number Faker.numerify("800 ### ####") end |
#mobile_number ⇒ Object
Generates a fixed mobile phone number
8xxx xxxx
36 37 38 |
# File 'lib/ffakerer/phone_number_sg.rb', line 36 def mobile_number Faker.numerify("8### ####") end |
#mobile_or_pager_number ⇒ Object
Generates a fixed mobile phone number or pager service number
9xxx xxxx
43 44 45 |
# File 'lib/ffakerer/phone_number_sg.rb', line 43 def mobile_or_pager_number Faker.numerify("9### ####") end |
#phone_number ⇒ Object
generates mobile or home/work number
69 70 71 72 73 74 75 |
# File 'lib/ffakerer/phone_number_sg.rb', line 69 def phone_number case rand(3) when 0 then fixed_line_number when 1 then mobile_number when 2 then mobile_or_pager_number end end |
#premium_service_number ⇒ Object
Generates a premium service number
(1900) xxx xxxx
64 65 66 |
# File 'lib/ffakerer/phone_number_sg.rb', line 64 def premium_service_number Faker.numerify("1900 ### ####") end |