Skip to content

Commit

Permalink
Implement required method #coordinates.
Browse files Browse the repository at this point in the history
Remove unnecessary methods #latitude and #longitude (implemented by base
lookup).
  • Loading branch information
alexreisner committed Nov 24, 2020
1 parent 6697c7b commit f9af50b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/geocoder/results/ipregistry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ def initialize(data)
@data = flatten_hash(data)
end

def coordinates
[@data['location_latitude'], @data['location_longitude']]
end

def flatten_hash(hash)
hash.each_with_object({}) do |(k, v), h|
if v.is_a? Hash
Expand All @@ -35,14 +39,6 @@ def country_code
@data['location_country_code']
end

def latitude
@data['location_latitude']
end

def longitude
@data['location_longitude']
end

def postal_code
@data['location_postal']
end
Expand Down

0 comments on commit f9af50b

Please sign in to comment.