Sha256: c44a761ca33f9d348c16fcce65c810f384c8d9477d660e938286dc07fb6866f5
Contents?: true
Size: 921 Bytes
Versions: 12
Compression:
Stored size: 921 Bytes
Contents
# frozen_string_literal: true module FFaker module PhoneNumberUA extend ModuleUtils extend self LOCAL_PREFIX = '0' COUNTRY_PREFIX = '+380 ' PHONE_NUMBER = ' ###-####' def phone_number rand(0..1).zero? ? home_phone_number : mobile_phone_number end def home_phone_number local_number(HOME_PHONE_PREFIXES) end def mobile_phone_number local_number(MOBILE_PHONE_PREFIXES) end def international_home_phone_number international_number(HOME_PHONE_PREFIXES) end def international_mobile_phone_number international_number(MOBILE_PHONE_PREFIXES) end private def local_number(prefixes) FFaker.numerify([LOCAL_PREFIX, fetch_sample(prefixes), PHONE_NUMBER].join('')) end def international_number(prefixes) FFaker.numerify([COUNTRY_PREFIX, fetch_sample(prefixes), PHONE_NUMBER].join('')) end end end
Version data entries
12 entries across 12 versions & 1 rubygems