Module: FFaker::AddressUA

Extended by:
AddressUA, ModuleUtils
Included in:
AddressUA
Defined in:
lib/ffaker/address_ua.rb

Constant Summary collapse

POSTAL_CODE_FORMAT =
['#####']
BUILDING_NUMBER_FORMATS =
%w(## # ###)
APPARTMENT_NUMBER_FORMATS =
%w(# ## ###)

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore

Instance Method Details

#appartment_numberObject


44
45
46
# File 'lib/ffaker/address_ua.rb', line 44

def appartment_number
  numerify_mask(APPARTMENT_NUMBER_FORMATS)
end

#building_numberObject


40
41
42
# File 'lib/ffaker/address_ua.rb', line 40

def building_number
  numerify_mask(BUILDING_NUMBER_FORMATS)
end

#cityObject


18
19
20
# File 'lib/ffaker/address_ua.rb', line 18

def city
  CITY.sample
end

#countryObject


14
15
16
# File 'lib/ffaker/address_ua.rb', line 14

def country
  COUNTRY.sample
end

#provinceObject


22
23
24
# File 'lib/ffaker/address_ua.rb', line 22

def province
  PROVINCE.sample
end

#street_address(include_secondary = false) ⇒ Object


34
35
36
37
38
# File 'lib/ffaker/address_ua.rb', line 34

def street_address(include_secondary = false)
  str = "#{street_name}, #{building_number}"
  str << ", кв. #{appartment_number}" if include_secondary
  str
end

#street_nameObject


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

def street_name
  "вул. #{STREET.sample}"
end

#zip_codeObject


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

def zip_code
  numerify_mask(POSTAL_CODE_FORMAT, true)
end