Module: Faker::AddressCA

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

Constant Summary collapse

POSTAL_CODE_FORMATS =
k ['?#? #?#']
PROVINCE_ABBRS =
k %w(NL NS PE NB QC ON MB SK AB BC YT NT NU)

Constants included from Address

Faker::Address::CITY_PREFIXES, Faker::Address::COMPASS_DIRECTIONS, Faker::Address::SEC_ADDR

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore

Methods included from Address

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

Instance Method Details

#postal_codeObject



12
13
14
# File 'lib/ffakerer/address_ca.rb', line 12

def postal_code
  Faker.bothify(POSTAL_CODE_FORMATS.rand).upcase
end

#provinceObject



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

def province
  PROVINCE.rand
end

#province_abbrObject



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

def province_abbr
  PROVINCE_ABBRS.rand
end