Sha256: 0254434a1847b0201ca2537c63752a6170aedc2d4955fcedd71b131422662313
Contents?: true
Size: 1.24 KB
Versions: 1
Compression:
Stored size: 1.24 KB
Contents
# frozen_string_literal: true module FFakerTW module PhoneNumberNL extend ModuleUtils extend self COUNTRY_CODE = '+31' AREA_CODE_PREFIX = '0' PHONE_NUMBER = { 2 => ['#######', '### ####', '#### ###'], 3 => ['######', '#### ##', '## ## ##'] }.freeze MOBILE_PHONE_NUMBER = ['########', ' ## ## ## ##', ' ### ### ##', ' #### ####'].freeze def phone_number return home_work_phone_number if rand(0..1).zero? mobile_phone_number end def home_work_phone_number area = fetch_sample(AREA_CODES) FFakerTW.numerify "#{AREA_CODE_PREFIX}#{area}-#{fetch_sample(PHONE_NUMBER[area.size])}" end def mobile_phone_number FFakerTW.numerify "#{AREA_CODE_PREFIX}6#{fetch_sample(MOBILE_PHONE_NUMBER)}" end def international_phone_number return international_mobile_phone_number if rand(0..1).zero? international_home_work_phone_number end def international_home_work_phone_number area = fetch_sample(AREA_CODES) FFakerTW.numerify("#{COUNTRY_CODE} #{area}-#{fetch_sample(PHONE_NUMBER[area.size])}") end def international_mobile_phone_number FFakerTW.numerify("#{COUNTRY_CODE} 6#{fetch_sample(MOBILE_PHONE_NUMBER)}") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ffakerTW-0.1.0 | lib/ffakerTW/phone_number_nl.rb |