Module: FFaker::AddressCA

Extended by:
AddressCA, ModuleUtils
Includes:
Address
Included in:
AddressCA
Defined in:
lib/ffaker/address_ca.rb

Constant Summary collapse

POSTAL_CODE_FORMAT =
'?#? #?#'
POSTAL_CODE_CHARS =
%w[A B C E G H J K L M N P R S T V X Y].freeze
PROVINCE_ABBRS =
%w[NL NS PE NB QC ON MB SK AB BC YT NT NU].freeze

Constants included from Address

FFaker::Address::CITY_PREFIXES, FFaker::Address::COMPASS_DIRECTIONS, FFaker::Address::SEC_ADDR

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, luhn_check, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Methods included from Address

#building_number, #city_prefix, #city_suffix, #country, #country_code, #neighborhood, #secondary_address, #street_address, #street_name, #street_suffix, #time_zone, #uk_country, #uk_county, #uk_postcode, #us_state, #us_state_abbr, #zip_code

Instance Method Details

#cityObject



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

def city
  fetch_sample(CITY)
end

#postal_codeObject



16
17
18
# File 'lib/ffaker/address_ca.rb', line 16

def postal_code
  FFaker.numerify(POSTAL_CODE_FORMAT.gsub('?') { fetch_sample(POSTAL_CODE_CHARS) })
end

#provinceObject



20
21
22
# File 'lib/ffaker/address_ca.rb', line 20

def province
  fetch_sample(PROVINCE)
end

#province_abbrObject



28
29
30
# File 'lib/ffaker/address_ca.rb', line 28

def province_abbr
  fetch_sample(PROVINCE_ABBRS)
end