class Geocoder::Lookup::LocationIq

def results(query)

def results(query)
  return [] unless doc = fetch_data(query)
  if !doc.is_a?(Array)
    case doc['error']
    when "Invalid key"
      raise_error(Geocoder::InvalidApiKey, doc['error'])
    when "Key not active - Please write to contact@unwiredlabs.com"
      raise_error(Geocoder::RequestDenied, doc['error'])
    when "Rate Limited"
      raise_error(Geocoder::OverQueryLimitError, doc['error'])
    when "Unknown error - Please try again after some time"
      raise_error(Geocoder::InvalidRequest, doc['error'])
    end
  end
  doc.is_a?(Array) ? doc : [doc]
end