Module: FFaker::PhoneNumberSG

Extended by:
ModuleUtils, PhoneNumberSG
Included in:
PhoneNumberSG
Defined in:
lib/ffaker/phone_number_sg.rb

Overview

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore

Instance Method Details

#country_codeObject


77
78
79
# File 'lib/ffaker/phone_number_sg.rb', line 77

def country_code
  '+65'
end

#fixed_line_numberObject

Generates a fixed line phone number

6xxx xxxx

29
30
31
# File 'lib/ffaker/phone_number_sg.rb', line 29

def fixed_line_number
  FFaker.numerify('6### ####')
end

#international_toll_free_numberObject

Generates an international toll-free number

800 xxx xxxx

50
51
52
# File 'lib/ffaker/phone_number_sg.rb', line 50

def international_toll_free_number
  FFaker.numerify('800 ### ####')
end

#mobile_numberObject

Generates a fixed mobile phone number

8xxx xxxx

36
37
38
# File 'lib/ffaker/phone_number_sg.rb', line 36

def mobile_number
  FFaker.numerify('8### ####')
end

#mobile_or_pager_numberObject

Generates a fixed mobile phone number or pager service number

9xxx xxxx

43
44
45
# File 'lib/ffaker/phone_number_sg.rb', line 43

def mobile_or_pager_number
  FFaker.numerify('9### ####')
end

#phone_numberObject

generates mobile or home/work number


69
70
71
72
73
74
75
# File 'lib/ffaker/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_numberObject

Generates a premium service number

(1900) xxx xxxx

64
65
66
# File 'lib/ffaker/phone_number_sg.rb', line 64

def premium_service_number
  FFaker.numerify('1900 ### ####')
end

#toll_free_numberObject

Generates an toll-free number

1800 xxx xxxx

57
58
59
# File 'lib/ffaker/phone_number_sg.rb', line 57

def toll_free_number
  FFaker.numerify('1800 ### ####')
end

#voip_numberObject

Generates a voip phone number

3xxx xxxx

22
23
24
# File 'lib/ffaker/phone_number_sg.rb', line 22

def voip_number
  FFaker.numerify('3### ####')
end