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)
PROVINCE_ABBRS =
%w(NL NS PE NB QC ON MB SK AB BC YT NT NU)

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, underscore

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
  CITY.sample
end

#postal_codeObject


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

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

#provinceObject


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

def province
  PROVINCE.sample
end

#province_abbrObject


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

def province_abbr
  PROVINCE_ABBRS.sample
end