jp_prefecture 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/lib/jp_prefecture/mapping.rb +47 -47
- data/lib/jp_prefecture/prefecture.rb +2 -2
- data/lib/jp_prefecture/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG.md
CHANGED
@@ -5,53 +5,53 @@ module JpPrefecture
|
|
5
5
|
# JIS X 0402 で定義されている都道府県コードと都道府県名をベースに
|
6
6
|
# コードがゼロから始まるもの(09 など)を 1 ケタにしたもの
|
7
7
|
PREFECTURE_CODE_NAME = {
|
8
|
-
1 => { name: '北海道', name_e: '
|
9
|
-
2 => { name: '青森県', name_e: '
|
10
|
-
3 => { name: '岩手県', name_e: '
|
11
|
-
4 => { name: '宮城県', name_e: '
|
12
|
-
5 => { name: '秋田県', name_e: '
|
13
|
-
6 => { name: '山形県', name_e: '
|
14
|
-
7 => { name: '福島県', name_e: '
|
15
|
-
8 => { name: '茨城県', name_e: '
|
16
|
-
9 => { name: '栃木県', name_e: '
|
17
|
-
10 => { name: '群馬県', name_e: '
|
18
|
-
11 => { name: '埼玉県', name_e: '
|
19
|
-
12 => { name: '千葉県', name_e: '
|
20
|
-
13 => { name: '東京都', name_e: '
|
21
|
-
14 => { name: '神奈川県', name_e: '
|
22
|
-
15 => { name: '新潟県', name_e: '
|
23
|
-
16 => { name: '富山県', name_e: '
|
24
|
-
17 => { name: '石川県', name_e: '
|
25
|
-
18 => { name: '福井県', name_e: '
|
26
|
-
19 => { name: '山梨県', name_e: '
|
27
|
-
20 => { name: '長野県', name_e: '
|
28
|
-
21 => { name: '岐阜県', name_e: '
|
29
|
-
22 => { name: '静岡県', name_e: '
|
30
|
-
23 => { name: '愛知県', name_e: '
|
31
|
-
24 => { name: '三重県', name_e: '
|
32
|
-
25 => { name: '滋賀県', name_e: '
|
33
|
-
26 => { name: '京都府', name_e: '
|
34
|
-
27 => { name: '大阪府', name_e: '
|
35
|
-
28 => { name: '兵庫県', name_e: '
|
36
|
-
29 => { name: '奈良県', name_e: '
|
37
|
-
30 => { name: '和歌山県', name_e: '
|
38
|
-
31 => { name: '鳥取県', name_e: '
|
39
|
-
32 => { name: '島根県', name_e: '
|
40
|
-
33 => { name: '岡山県', name_e: '
|
41
|
-
34 => { name: '広島県', name_e: '
|
42
|
-
35 => { name: '山口県', name_e: '
|
43
|
-
36 => { name: '徳島県', name_e: '
|
44
|
-
37 => { name: '香川県', name_e: '
|
45
|
-
38 => { name: '愛媛県', name_e: '
|
46
|
-
39 => { name: '高知県', name_e: '
|
47
|
-
40 => { name: '福岡県', name_e: '
|
48
|
-
41 => { name: '佐賀県', name_e: '
|
49
|
-
42 => { name: '長崎県', name_e: '
|
50
|
-
43 => { name: '熊本県', name_e: '
|
51
|
-
44 => { name: '大分県', name_e: '
|
52
|
-
45 => { name: '宮崎県', name_e: '
|
53
|
-
46 => { name: '鹿児島県', name_e: '
|
54
|
-
47 => { name: '沖縄県', name_e: '
|
8
|
+
1 => { name: '北海道', name_e: 'hokkaido' },
|
9
|
+
2 => { name: '青森県', name_e: 'aomori' },
|
10
|
+
3 => { name: '岩手県', name_e: 'iwate' },
|
11
|
+
4 => { name: '宮城県', name_e: 'miyagi' },
|
12
|
+
5 => { name: '秋田県', name_e: 'akita' },
|
13
|
+
6 => { name: '山形県', name_e: 'yamagata' },
|
14
|
+
7 => { name: '福島県', name_e: 'fukushima' },
|
15
|
+
8 => { name: '茨城県', name_e: 'ibaraki' },
|
16
|
+
9 => { name: '栃木県', name_e: 'tochigi' },
|
17
|
+
10 => { name: '群馬県', name_e: 'gunma' },
|
18
|
+
11 => { name: '埼玉県', name_e: 'saitama' },
|
19
|
+
12 => { name: '千葉県', name_e: 'chiba' },
|
20
|
+
13 => { name: '東京都', name_e: 'tokyo' },
|
21
|
+
14 => { name: '神奈川県', name_e: 'kanagawa' },
|
22
|
+
15 => { name: '新潟県', name_e: 'niigata' },
|
23
|
+
16 => { name: '富山県', name_e: 'toyama' },
|
24
|
+
17 => { name: '石川県', name_e: 'ishikawa' },
|
25
|
+
18 => { name: '福井県', name_e: 'fukui' },
|
26
|
+
19 => { name: '山梨県', name_e: 'yamanashi' },
|
27
|
+
20 => { name: '長野県', name_e: 'nagano' },
|
28
|
+
21 => { name: '岐阜県', name_e: 'gifu' },
|
29
|
+
22 => { name: '静岡県', name_e: 'shizuoka' },
|
30
|
+
23 => { name: '愛知県', name_e: 'aichi' },
|
31
|
+
24 => { name: '三重県', name_e: 'mie' },
|
32
|
+
25 => { name: '滋賀県', name_e: 'shiga' },
|
33
|
+
26 => { name: '京都府', name_e: 'kyoto' },
|
34
|
+
27 => { name: '大阪府', name_e: 'osaka' },
|
35
|
+
28 => { name: '兵庫県', name_e: 'hyogo' },
|
36
|
+
29 => { name: '奈良県', name_e: 'nara' },
|
37
|
+
30 => { name: '和歌山県', name_e: 'wakayama' },
|
38
|
+
31 => { name: '鳥取県', name_e: 'tottori' },
|
39
|
+
32 => { name: '島根県', name_e: 'shimane' },
|
40
|
+
33 => { name: '岡山県', name_e: 'okayama' },
|
41
|
+
34 => { name: '広島県', name_e: 'hiroshima' },
|
42
|
+
35 => { name: '山口県', name_e: 'yamaguchi' },
|
43
|
+
36 => { name: '徳島県', name_e: 'tokushima' },
|
44
|
+
37 => { name: '香川県', name_e: 'kagawa' },
|
45
|
+
38 => { name: '愛媛県', name_e: 'ehime' },
|
46
|
+
39 => { name: '高知県', name_e: 'kochi' },
|
47
|
+
40 => { name: '福岡県', name_e: 'fukuoka' },
|
48
|
+
41 => { name: '佐賀県', name_e: 'saga' },
|
49
|
+
42 => { name: '長崎県', name_e: 'nagasaki' },
|
50
|
+
43 => { name: '熊本県', name_e: 'kumamoto' },
|
51
|
+
44 => { name: '大分県', name_e: 'oita' },
|
52
|
+
45 => { name: '宮崎県', name_e: 'miyazaki' },
|
53
|
+
46 => { name: '鹿児島県', name_e: 'kagoshima' },
|
54
|
+
47 => { name: '沖縄県', name_e: 'okinawa' },
|
55
55
|
}
|
56
56
|
end
|
57
57
|
end
|
@@ -22,7 +22,7 @@ module JpPrefecture
|
|
22
22
|
|
23
23
|
p.code = code
|
24
24
|
p.name = name
|
25
|
-
p.name_e = name_e
|
25
|
+
p.name_e = name_e.capitalize
|
26
26
|
|
27
27
|
p
|
28
28
|
end
|
@@ -95,7 +95,7 @@ module JpPrefecture
|
|
95
95
|
# 名前から都道府県コードを検索
|
96
96
|
def self.find_code_by_name(name)
|
97
97
|
result = PREFECTURE_CODE_NAME.select { |_, v|
|
98
|
-
v.has_value?(name.
|
98
|
+
v.has_value?(name.downcase)
|
99
99
|
}.first
|
100
100
|
|
101
101
|
return if result.nil?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jp_prefecture
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|