Module: FFaker::AddressKR
Constant Summary
collapse
- BUILDING_DONGS =
%w[가 나 다 라 마 바 ## ###].freeze
- BUILDING_SUFFIXES =
%w[빌라 아파트 연립 마을 타운 타워].freeze
- STREET_SUFFIXES =
%w[로 #로 가 #가 거리 길].freeze
- TOWN_SUFFIXES =
%w[동 리 마을].freeze
- METROPOLITAN_CITIES =
%w[서울특별시 부산광역시 대구광역시 인천광역시
광주광역시 대전광역시 울산광역시 세종특별자치시].freeze
- PROVINCES =
%w[경기도 강원도 충청북도 충청남도 전라북도 전라남도 경상북도
경상남도 제주특별자치도].freeze
Instance Method Summary
collapse
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Instance Method Details
#address_detail ⇒ Object
55
56
57
58
59
60
61
|
# File 'lib/ffaker/address_kr.rb', line 55
def address_detail
FFaker.numerify(fetch_sample([
building_name,
"#{building_name} ###호",
"#{building_name} #{fetch_sample(BUILDING_DONGS)} ###호"
]))
end
|
#borough ⇒ Object
71
72
73
|
# File 'lib/ffaker/address_kr.rb', line 71
def borough
fetch_sample(BOROUGHS)
end
|
#city ⇒ Object
75
76
77
|
# File 'lib/ffaker/address_kr.rb', line 75
def city
fetch_sample(CITIES)
end
|
#land_address ⇒ Object
34
35
36
37
38
39
|
# File 'lib/ffaker/address_kr.rb', line 34
def land_address
fetch_sample([
"#{metropolitan_city} #{borough} #{town} #{land_number}",
"#{province} #{town} #{land_number}"
])
end
|
#land_number ⇒ Object
41
42
43
44
45
46
47
48
49
|
# File 'lib/ffaker/address_kr.rb', line 41
def land_number
FFaker.numerify(fetch_sample([
'###',
'###-#',
'###-##',
'####',
'####-#'
]))
end
|
#metropolitan_city ⇒ Object
83
84
85
|
# File 'lib/ffaker/address_kr.rb', line 83
def metropolitan_city
fetch_sample(METROPOLITAN_CITIES)
end
|
#old_postal_code ⇒ Object
21
22
23
|
# File 'lib/ffaker/address_kr.rb', line 21
def old_postal_code
FFaker.numerify('###-###')
end
|
#postal_code ⇒ Object
17
18
19
|
# File 'lib/ffaker/address_kr.rb', line 17
def postal_code
FFaker.numerify('#####')
end
|
#province ⇒ Object
79
80
81
|
# File 'lib/ffaker/address_kr.rb', line 79
def province
fetch_sample(PROVINCES)
end
|
#road_addess ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'lib/ffaker/address_kr.rb', line 25
def road_addess
fetch_sample([
"#{metropolitan_city} #{borough} #{street}",
"#{province} #{town} #{street}",
"#{metropolitan_city} #{borough} #{street} (#{town})",
"#{province} #{town} #{street} (#{town})"
])
end
|