Module: FFaker::AddressFR

Extended by:
AddressFR, ModuleUtils
Includes:
Address
Included in:
AddressFR
Defined in:
lib/ffaker/address_fr.rb

Constant Summary collapse

NUM =
['#', '##', '##', '###', '####', '#-##'].freeze
MOD =
[' B', ' T', ' Q', ' BIS', ' TER', ' QUATER', '', '', '', ''].freeze
SEP =
[', ', ' '].freeze
TYPE =
%w[rue avenue av boulevard bd impasse].freeze
POSTAL_CODE_FORMATS =
['#####', '97###', '2A###', '2B###'].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_name, #street_suffix, #time_zone, #uk_country, #uk_county, #uk_postcode, #us_state, #us_state_abbr, #zip_code

Instance Method Details

#cityObject



26
27
28
# File 'lib/ffaker/address_fr.rb', line 26

def city
  fetch_sample(CITY)
end

#full_addressObject



30
31
32
# File 'lib/ffaker/address_fr.rb', line 30

def full_address
  %(#{street_address}#{fetch_sample(SEP)}#{postal_code} #{fetch_sample(CITY)})
end

#postal_codeObject



22
23
24
# File 'lib/ffaker/address_fr.rb', line 22

def postal_code
  FFaker.numerify(fetch_sample(POSTAL_CODE_FORMATS))
end

#regionObject



34
35
36
# File 'lib/ffaker/address_fr.rb', line 34

def region
  fetch_sample(REGION)
end

#street_addressObject



16
17
18
19
20
# File 'lib/ffaker/address_fr.rb', line 16

def street_address
  <<~TEXT.chomp
    #{FFaker.numerify(fetch_sample(NUM))}#{fetch_sample(MOD)}#{fetch_sample(SEP)}#{fetch_sample(TYPE)} #{FFaker::NameFR.name}
  TEXT
end