jp_zip_code 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jp_zip_code.rb +7 -1
- data/lib/jp_zip_code/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e290002e137bf4cd02f53d7d2cda45d86924b9c5
|
4
|
+
data.tar.gz: bd03bbebc89e81b7ce2b5a59efe2b7aa8cee414e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 784451997f12f43e7074d3dbdadf6402a2add0f5b888b93072ceb6efb113e31b46760c5bff1035b64a4c0665579de012b292865a515864ba68a7ecb18e8687b2
|
7
|
+
data.tar.gz: bfbfd1b7a7984a508e3cae9c3176b0a2c58b1a12c889fa6007ac628178e4d77a6a9e696f20da33ec63641e74bafe940f45c79c914eb33a702cc2040db9e75b3f
|
data/lib/jp_zip_code.rb
CHANGED
@@ -19,8 +19,10 @@ module JpZipCode
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.convert(data)
|
22
|
+
data['pref_code'] = pref_codes.invert[data['pref_kanji']].to_s
|
23
|
+
|
22
24
|
data.each_with_object({}) do |(key, value), hash|
|
23
|
-
converted = %w(イカニケイサイガナイバアイ IKANIKEISAIGANAIBAAI 以下に掲載がない場合).include?(value) ?
|
25
|
+
converted = %w(イカニケイサイガナイバアイ IKANIKEISAIGANAIBAAI 以下に掲載がない場合).include?(value) ? '' : value
|
24
26
|
converted = converted.gsub(/\(.*\)/, '').gsub(/(.*)/, '')
|
25
27
|
converted = converted.split(' ').map(&:capitalize).join(' ')
|
26
28
|
%w(Ken To Fu Shi Gun Ku Machi).each do |suffix|
|
@@ -30,6 +32,10 @@ module JpZipCode
|
|
30
32
|
end
|
31
33
|
end
|
32
34
|
|
35
|
+
def self.pref_codes
|
36
|
+
YAML.load(File.open('data/pref_code.yaml'))
|
37
|
+
end
|
38
|
+
|
33
39
|
def self.update
|
34
40
|
JpZipCode::Updater.new(false).execute
|
35
41
|
end
|
data/lib/jp_zip_code/version.rb
CHANGED