Module: FFaker::AddressBR
Constant Summary
collapse
- STREET_PREFIX =
%w[Rua Avenida Travessa Alameda].freeze
Constants included
from Address
FFaker::Address::CITY_PREFIXES, FFaker::Address::COMPASS_DIRECTIONS, FFaker::Address::SEC_ADDR
Instance Method Summary
collapse
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Methods included from Address
#building_number, #city_prefix, #city_suffix, #country, #country_code, #secondary_address, #street_address, #street_name, #street_suffix, #time_zone, #uk_country, #uk_county, #uk_postcode, #us_state, #us_state_abbr
Instance Method Details
#city ⇒ Object
26
27
28
|
# File 'lib/ffaker/address_br.rb', line 26
def city
fetch_sample(CITY)
end
|
#complement ⇒ Object
41
42
43
|
# File 'lib/ffaker/address_br.rb', line 41
def complement
FFaker.numerify(fetch_sample(COMPLEMENT))
end
|
#full_address(with_complement: false) ⇒ Object
50
51
52
53
54
55
|
# File 'lib/ffaker/address_br.rb', line 50
def full_address(with_complement: false)
base_address_order = [street, building_number, neighborhood, city, state, 'Brazil']
return base_address_order.join(', ') unless with_complement
base_address_order.insert(2, complement).join(', ')
end
|
#neighborhood ⇒ Object
45
46
47
48
|
# File 'lib/ffaker/address_br.rb', line 45
def neighborhood
prefix = fetch_sample(NEIGHBORHOOD_PREFIXES)
"#{prefix} #{NameBR.first_name}"
end
|
#state ⇒ Object
18
19
20
|
# File 'lib/ffaker/address_br.rb', line 18
def state
fetch_sample(STATE)
end
|
#state_abbr ⇒ Object
22
23
24
|
# File 'lib/ffaker/address_br.rb', line 22
def state_abbr
fetch_sample(STATE_ABBR)
end
|
#street_prefix ⇒ Object
30
31
32
|
# File 'lib/ffaker/address_br.rb', line 30
def street_prefix
fetch_sample(STREET_PREFIX)
end
|
#zip_code ⇒ Object
14
15
16
|
# File 'lib/ffaker/address_br.rb', line 14
def zip_code
FFaker.numerify '#####-###'
end
|