postcode_three_country 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/postcode_three_country/version.rb +1 -1
- data/lib/postcode_three_country.rb +9 -8
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e0889556617142fa20a67d1b8de028379c15872d7be3fa59513167f1219f801f
|
|
4
|
+
data.tar.gz: e96cf722f6bb36ba1e9d16a01cefd2483d71859405f1a95d84e5b4be87d11f65
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 69a50c0d051a31a2542b84c5e47b8e93e77d67c62d1a3c8da731b4c7a0bfd06ea4cc407ecf2ef011a20fd0d94ec8dc9f6b9c67490a3a6fa6d438ac63ee23194c
|
|
7
|
+
data.tar.gz: 21e372143758fd38467d8235676fa2498c54d8e577be82baebc2c03c56f2db36d83a120b3e400670f1eb1235ec7ab8d7dfce998528f2090876b70c8bd2c8c95e
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require_relative "postcode_three_country/version"
|
|
2
2
|
require "yaml"
|
|
3
|
+
require "pry"
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
module PostcodeThreeCountry
|
|
@@ -24,7 +25,7 @@ module PostcodeThreeCountry
|
|
|
24
25
|
vi_country
|
|
25
26
|
|
|
26
27
|
array_country = @vi_postcode['vietnam'].values
|
|
27
|
-
find_city = find_city.gsub(/\D
|
|
28
|
+
find_city = find_city.gsub(/\D/, '')
|
|
28
29
|
first_word = find_city.split('')[0]
|
|
29
30
|
array_postcode = []
|
|
30
31
|
array_city = []
|
|
@@ -47,7 +48,7 @@ module PostcodeThreeCountry
|
|
|
47
48
|
jp_country
|
|
48
49
|
|
|
49
50
|
array_country = @jp_postcode['japan'].values
|
|
50
|
-
find_city = find_city.gsub(/\D
|
|
51
|
+
find_city = find_city.gsub(/\D/, '')
|
|
51
52
|
first_word = find_city.split('')[0]
|
|
52
53
|
array_postcode = []
|
|
53
54
|
array_city = []
|
|
@@ -70,7 +71,7 @@ module PostcodeThreeCountry
|
|
|
70
71
|
eng_country
|
|
71
72
|
|
|
72
73
|
array_country = @eng_postcode['england'].values
|
|
73
|
-
find_city = find_city.gsub(/\D
|
|
74
|
+
find_city = find_city.gsub(/\D/, '')
|
|
74
75
|
first_word = find_city.split('')[0]
|
|
75
76
|
array_postcode = []
|
|
76
77
|
array_city = []
|
|
@@ -93,7 +94,7 @@ module PostcodeThreeCountry
|
|
|
93
94
|
vi_country
|
|
94
95
|
|
|
95
96
|
array_country = @vi_postcode['vietnam'].values
|
|
96
|
-
find_postcode = find_postcode.gsub(/[\W\d]/, '')
|
|
97
|
+
find_postcode = find_postcode.gsub(/[\W\d]/, '')
|
|
97
98
|
first_word = find_postcode.split('')[0]
|
|
98
99
|
array_postcode = []
|
|
99
100
|
array_city = []
|
|
@@ -107,9 +108,9 @@ module PostcodeThreeCountry
|
|
|
107
108
|
puts postcode.values[0] if postcode.has_value?(find_postcode)
|
|
108
109
|
end
|
|
109
110
|
else
|
|
111
|
+
# binding.pry
|
|
110
112
|
puts array_city.map { |v| puts v if v.start_with?(first_word) }
|
|
111
113
|
end
|
|
112
|
-
# binding.pry
|
|
113
114
|
end
|
|
114
115
|
|
|
115
116
|
# Xử lý khi tìm Postcode bằng tên thành phố của Japan
|
|
@@ -117,7 +118,7 @@ module PostcodeThreeCountry
|
|
|
117
118
|
jp_country
|
|
118
119
|
|
|
119
120
|
array_country = @jp_postcode['japan'].values
|
|
120
|
-
find_postcode = find_postcode.gsub(/[\W\d]/, '')
|
|
121
|
+
find_postcode = find_postcode.gsub(/[\W\d]/, '')
|
|
121
122
|
first_word = find_postcode.split('')[0]
|
|
122
123
|
array_postcode = []
|
|
123
124
|
array_city = []
|
|
@@ -141,7 +142,7 @@ module PostcodeThreeCountry
|
|
|
141
142
|
eng_country
|
|
142
143
|
|
|
143
144
|
array_country = @eng_postcode['england'].values
|
|
144
|
-
find_postcode = find_postcode.gsub(/[\W\d]/, '')
|
|
145
|
+
find_postcode = find_postcode.gsub(/[\W\d]/, '')
|
|
145
146
|
first_word = find_postcode.split('')[0]
|
|
146
147
|
array_postcode = []
|
|
147
148
|
array_city = []
|
|
@@ -159,4 +160,4 @@ module PostcodeThreeCountry
|
|
|
159
160
|
end
|
|
160
161
|
# binding.pry
|
|
161
162
|
end
|
|
162
|
-
end
|
|
163
|
+
end
|