Module: FFaker::PhoneNumberNL

Extended by:
ModuleUtils, PhoneNumberNL
Included in:
PhoneNumberNL
Defined in:
lib/ffaker/phone_number_nl.rb

Constant Summary collapse

COUNTRY_CODE =
'+31'
AREA_CODE_PREFIX =
'0'
PHONE_NUMBER =
{
  2 => ['#######', '### ####', '#### ###'],
  3 => ['######', '#### ##', '## ## ##']
}
AREA_CODES =
%w(10 111 113 114 115 117 118 13 14 15 161 162 164 165 166 167 168 172 174 180 181 182 183 184 186 187 20 222 223 224 226 227 228 229 23 24 251 252 255 26 294 297 299 30 313 314 315 316 317 318 320 321 33 341 342 343 344 345 346 347 348 35 36 38 40 411 412 413 416 418 43 45 46 475 478 481 485 486 487 488 492 493 495 497 499 50 511 512 513 514 515 516 517 518 519 521 522 523 524 525 527 528 529 53 541 543 544 545 546 547 548 55 561 562 566 570 571 572 573 575 577 578 58 591 592 593 594 595 596 597 598 599 70 71 72 73 74 75 76 77 78 79)
MOBILE_PHONE_NUMBER =
['########', ' ## ## ## ##', ' ### ### ##', ' #### ####']

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore

Instance Method Details

#home_work_phone_numberObject



24
25
26
27
# File 'lib/ffaker/phone_number_nl.rb', line 24

def home_work_phone_number
  area = AREA_CODES.sample
  FFaker.numerify "#{AREA_CODE_PREFIX}#{area}-#{PHONE_NUMBER[area.size].sample}"
end

#international_home_work_phone_numberObject



40
41
42
43
# File 'lib/ffaker/phone_number_nl.rb', line 40

def international_home_work_phone_number
  area = AREA_CODES.sample
  FFaker.numerify("#{COUNTRY_CODE} #{area}-#{PHONE_NUMBER[area.size].sample}")
end

#international_mobile_phone_numberObject



45
46
47
# File 'lib/ffaker/phone_number_nl.rb', line 45

def international_mobile_phone_number
  FFaker.numerify("#{COUNTRY_CODE} 6#{MOBILE_PHONE_NUMBER.sample}")
end

#international_phone_numberObject



33
34
35
36
37
38
# File 'lib/ffaker/phone_number_nl.rb', line 33

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_numberObject



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

def mobile_phone_number
  FFaker.numerify "#{AREA_CODE_PREFIX}6#{MOBILE_PHONE_NUMBER.sample}"
end

#phone_numberObject



17
18
19
20
21
22
# File 'lib/ffaker/phone_number_nl.rb', line 17

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