Module: FFaker::AddressUA
Constant Summary
collapse
- POSTAL_CODE_FORMAT =
['#####'].freeze
- BUILDING_NUMBER_FORMATS =
%w[## # ###].freeze
- APPARTMENT_NUMBER_FORMATS =
%w[# ## ###].freeze
Instance Method Summary
collapse
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Instance Method Details
#appartment_number ⇒ Object
#building_number ⇒ Object
#city ⇒ Object
16
17
18
|
# File 'lib/ffaker/address_ua.rb', line 16
def city
fetch_sample(CITY)
end
|
#country ⇒ Object
12
13
14
|
# File 'lib/ffaker/address_ua.rb', line 12
def country
fetch_sample(COUNTRY)
end
|
#province ⇒ Object
20
21
22
|
# File 'lib/ffaker/address_ua.rb', line 20
def province
fetch_sample(PROVINCE)
end
|
#street_address(include_secondary = false) ⇒ Object
32
33
34
35
36
|
# File 'lib/ffaker/address_ua.rb', line 32
def street_address(include_secondary = false)
str = +"#{street_name}, #{building_number}"
str << ", кв. #{appartment_number}" if include_secondary
str
end
|
#street_name ⇒ Object
28
29
30
|
# File 'lib/ffaker/address_ua.rb', line 28
def street_name
"вул. #{fetch_sample(STREET)}"
end
|
#zip_code ⇒ Object
24
25
26
|
# File 'lib/ffaker/address_ua.rb', line 24
def zip_code
numerify_mask(POSTAL_CODE_FORMAT, true)
end
|