class Geocoder::Lookup::PdokNl

def base_query_url(query)

def base_query_url(query)
  "#{protocol}://api.pdok.nl/bzk/locatieserver/search/v3_1/free?"
end

def cache_key(query)

def cache_key(query)
  base_query_url(query) + hash_to_query(query_url_params(query))
end

def name

def name
  'pdok NL'
end

def query_url_params(query)

def query_url_params(query)
  {
    fl: '*',
    q:  query.text,
    wt: 'json'
  }.merge(super)
end

def results(query)

def results(query)
  return [] unless doc = fetch_data(query)
  return doc['response']['docs']
end

def supported_protocols

def supported_protocols
  [:https]
end

def valid_response?(response)

def valid_response?(response)
  json   = parse_json(response.body)
  super(response) if json
end