lib/gogo_maps.rb in gogo_maps-0.0.5 vs lib/gogo_maps.rb in gogo_maps-0.2.70000000
- old
+ new
@@ -39,11 +39,15 @@
unless location = JSON.parse(response.body)['results'][0]
fail 'Something wrong with Google API or your params'
end
case sym
- when :to_latlng then location['geometry']['location']
- when :to_address then location['formatted_address']
+ when :to_latlng
+ location['geometry']['location'].each_with_object({}) do | (k, v), rslt |
+ rslt[k.to_s.to_sym] = v
+ end
+ when :to_address
+ location['formatted_address']
end
end
end
end