Module: FFaker::AddressFR

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

Constant Summary collapse

NUM =
['#', '##', '##', '###', '####', '#-##']
MOD =
[' B', ' T', ' Q', ' BIS', ' TER', ' QUATER', '', '', '', '']
SEP =
[', ', ' ']
TYPE =
%w(rue avenue av boulevard bd impasse)
POSTAL_CODE_FORMATS =
['####', '#####', '97####', '2A###', '2B###']

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_name, #street_suffix, #time_zone, #uk_country, #uk_county, #uk_postcode, #us_state, #us_state_abbr, #zip_code

Instance Method Details

#cityObject



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

def city
  CITY.sample
end

#full_addressObject



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

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

#postal_codeObject



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

def postal_code
  FFaker.numerify POSTAL_CODE_FORMATS.sample
end

#street_addressObject



18
19
20
21
22
23
24
# File 'lib/ffaker/address_fr.rb', line 18

def street_address
  FFaker.numerify(NUM.sample) +
    MOD.sample +
    SEP.sample +
    TYPE.sample + ' ' +
    FFaker::NameFR.name
end