Module: FFaker::AddressPL
Overview
Constant Summary
collapse
- STREET_PREFIXES =
%w[al. ul.].freeze
- SQUARE_PREFIXES =
%w[bulwar pasaż plac skwer zaułek].freeze
Instance Method Summary
collapse
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Instance Method Details
#building_number ⇒ Object
58
59
60
|
# File 'lib/ffaker/address_pl.rb', line 58
def building_number rand(1..199)
end
|
#city ⇒ Object
54
55
56
|
# File 'lib/ffaker/address_pl.rb', line 54
def city
fetch_sample(CITY)
end
|
#full_address(include_country = false, include_secondary = false) ⇒ Object
Full Polish address with country name in French (according to Universal Postal Union).
14
15
16
17
18
|
# File 'lib/ffaker/address_pl.rb', line 14
def full_address(include_country = false, include_secondary = false)
address = "#{street_address(include_secondary)} #{postal_code} #{city}"
address = "#{address} POLOGNE" if include_country
address
end
|
#secondary_number ⇒ Object
62
63
64
65
66
67
|
# File 'lib/ffaker/address_pl.rb', line 62
def secondary_number case rand(0..1)
when 0 then " m. #{building_number}"
when 1 then "/#{building_number}"
end
end
|
#square ⇒ Object
34
35
36
|
# File 'lib/ffaker/address_pl.rb', line 34
def square
"#{square_prefix} #{fetch_sample(SQUARE)}"
end
|
#square_prefix ⇒ Object
79
80
81
|
# File 'lib/ffaker/address_pl.rb', line 79
def square_prefix
fetch_sample(SQUARE_PREFIXES)
end
|
#street ⇒ Object
30
31
32
|
# File 'lib/ffaker/address_pl.rb', line 30
def street
"#{street_prefix} #{fetch_sample(STREET)}"
end
|
#street_address(include_secondary = false) ⇒ Object
20
21
22
23
24
|
# File 'lib/ffaker/address_pl.rb', line 20
def street_address(include_secondary = false)
address = "#{street_name} #{building_number}"
address = "#{address}#{secondary_number}" if include_secondary
address
end
|
#street_name ⇒ Object
26
27
28
|
# File 'lib/ffaker/address_pl.rb', line 26
def street_name
fetch_sample([street, square])
end
|
#street_prefix ⇒ Object
75
76
77
|
# File 'lib/ffaker/address_pl.rb', line 75
def street_prefix
fetch_sample(STREET_PREFIXES)
end
|
#voivodeship ⇒ Object
Also known as:
state, province
A voivodeship is an administrative area in Poland - a Polish equivalent of state.
39
40
41
|
# File 'lib/ffaker/address_pl.rb', line 39
def voivodeship
fetch_sample(VOIVODESHIP)
end
|
#voivodeship_abbr ⇒ Object
46
47
48
|
# File 'lib/ffaker/address_pl.rb', line 46
def voivodeship_abbr
fetch_sample(VOIVODESHIP_ABBR)
end
|
#voivodeship_capital_city ⇒ Object
50
51
52
|
# File 'lib/ffaker/address_pl.rb', line 50
def voivodeship_capital_city
fetch_sample(VOIVODESHIP_CAPITAL_CITY)
end
|
#zip_code ⇒ Object
Also known as:
postal_code
69
70
71
|
# File 'lib/ffaker/address_pl.rb', line 69
def zip_code
FFaker.numerify('##-###')
end
|