lib/geocoder/results/smarty_streets.rb in geocoder-1.4.3 vs lib/geocoder/results/smarty_streets.rb in geocoder-1.4.4
- old
+ new
@@ -1,11 +1,17 @@
require 'geocoder/lookups/base'
module Geocoder::Result
class SmartyStreets < Base
def coordinates
- %w(latitude longitude).map do |i|
+ result = %w(latitude longitude).map do |i|
zipcode_endpoint? ? zipcodes.first[i] : metadata[i]
+ end
+
+ if result.compact.empty?
+ nil
+ else
+ result
end
end
def address
[