Module: FFaker::AddressIT

Extended by:
AddressIT, ModuleUtils
Included in:
AddressIT
Defined in:
lib/ffaker/address_it.rb

Constant Summary collapse

NUM =
['#', '##', '##', '###', '####', '#-##'].freeze
SEP =
[', ', ' '].freeze
TYPE =
%w[via viale piazza piazzale].freeze
POSTAL_CODE_FORMATS =
['#####'].freeze

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, luhn_check, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#cityObject



21
22
23
# File 'lib/ffaker/address_it.rb', line 21

def city
  fetch_sample(CITY)
end

#full_addressObject



25
26
27
# File 'lib/ffaker/address_it.rb', line 25

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

#postal_codeObject



17
18
19
# File 'lib/ffaker/address_it.rb', line 17

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

#regionObject



29
30
31
# File 'lib/ffaker/address_it.rb', line 29

def region
  fetch_sample(REGION)
end

#street_addressObject



13
14
15
# File 'lib/ffaker/address_it.rb', line 13

def street_address
  "#{FFaker.numerify(fetch_sample(NUM))}#{fetch_sample(SEP)}#{fetch_sample(TYPE)} #{FFaker::NameIT.name}"
end