diff --git a/lib/geocoder/results/ipregistry.rb b/lib/geocoder/results/ipregistry.rb index 33e3193d1..71795596e 100644 --- a/lib/geocoder/results/ipregistry.rb +++ b/lib/geocoder/results/ipregistry.rb @@ -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 @@ -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