geocoder-olleh 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d628203c7f2d8c4d9b65024f9c9ead15eb333a30
4
- data.tar.gz: 2f84ed69fe48d219042f46e885bae09f45efba1c
3
+ metadata.gz: 81db180acec343ca4cc12fe807db4b57a1da9563
4
+ data.tar.gz: 01cff3aecee2aab369956b3be32e82c5582d066d
5
5
  SHA512:
6
- metadata.gz: f0c52597b0d87e1991f4558acc04596cfc73f3ef698f2acf6b2694c22bc07230f5c6d10d541ff35415e3a8b9603d372754d65698157917d1d955956e80a7367c
7
- data.tar.gz: 3ae8d44fcf965b377412f74f8f5f418a6d6efa9e9a2ca66de51392fce620bc8495c0919b55e53cf0a417b1424c5eada8236bad19fa7fed983f9f9dfd973c2f68
6
+ metadata.gz: e4253cb791f5d80443c2c7ed17085397d233e8f784d41fe78ca7d0bd0566c9fbd214cd32141202d6b4b283d46891750a0c65e07ed4b3424b1fadad5b79258fd0
7
+ data.tar.gz: c190f4d5184904b8240624dbcda44dc3fe94ab84e84a5924abc2dfda438c6d0c40d458cfd7eae97182a445f7a9740ef8e1b396529a1f43575da407f4e4188889
@@ -182,51 +182,46 @@ module Geocoder::Lookup
182
182
  EY: query.options[:end_y],
183
183
  RPTYPE: 0,
184
184
  COORDTYPE: Olleh.route_coord_types[query.options[:coord_type]] || 7,
185
- PRIORITY: Olleh.priority[query.options[:priority]],
186
- timestamp: now
187
- }
188
- (1..3).each do |x|
185
+ PRIORITY: Olleh.priority[query.options[:priority]]
186
+ }
187
+ (1..3).each do |x|
189
188
  s = [query.options[:"vx#{x}"], query.options[:"vy#{x}"]]
190
189
  hash.merge!({ "VX#{x}" => s[0], "VY#{x}" => s[1]}) unless s[0].nil? && s[1].nil?
191
190
  end
192
-
193
- JSON.generate(hash)
194
191
  when "convert_coord"
195
- JSON.generate({
192
+ hash = {
196
193
  x: query.text.first,
197
194
  y: query.text.last,
198
195
  inCoordType: Olleh.coord_types[query.options[:coord_in]],
199
- outCoordType: Olleh.coord_types[query.options[:coord_out]],
200
- timestamp: now
201
- })
196
+ outCoordType: Olleh.coord_types[query.options[:coord_out]]
197
+ }
202
198
  when "reverse_geocoding"
203
- JSON.generate({
199
+ hash = {
204
200
  x: query.text.first,
205
201
  y: query.text.last,
206
202
  addrcdtype: Olleh.addrcdtype[query.options[:addrcdtype]] || 0,
207
203
  newAddr: Olleh.new_addr_types[query.options[:new_addr_type]] || 0,
208
- isJibun: Olleh.include_jibun[query.options[:include_jibun]] || 0,
209
- timestamp: now
210
- })
204
+ isJibun: Olleh.include_jibun[query.options[:include_jibun]] || 0
205
+ }
211
206
  when "addr_step_search"
212
- JSON.generate({
213
- l_Code: query.options[:l_code],
214
- timestamp: now
215
- })
207
+ hash = {
208
+ l_Code: query.options[:l_code]
209
+ }
216
210
  when "addr_nearest_position_search"
217
- JSON.generate({
211
+ hash = {
218
212
  px: query.options[:px],
219
213
  py: query.options[:py],
220
- radius: query.options[:radius],
221
- timestamp: now
222
- })
214
+ radius: query.options[:radius]
215
+ }
223
216
  else # geocoding
224
- JSON.generate({
217
+ hash = {
225
218
  addr: URI.encode(query.sanitized_text),
226
- addrcdtype: Olleh.addrcdtype[query.options[:addrcdtype]],
227
- timestamp: now
228
- })
219
+ addrcdtype: Olleh.addrcdtype[query.options[:addrcdtype]]
220
+ }
229
221
  end
222
+
223
+ hash.merge!(timestamp: now)
224
+ JSON.generate(hash)
230
225
  end
231
226
 
232
227
  def now
@@ -1,5 +1,5 @@
1
1
  module Geocoder
2
2
  module Olleh
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geocoder-olleh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaigouk Kim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-07 00:00:00.000000000 Z
11
+ date: 2015-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler