def restaurants(params={})
      args = [ :entity_id, :entity_type, # location
               :q, :start, :count, :lat, :lon,
               :radius, :cuisines, :establishment_type,
               :collection_id, :category, :sort, :order,
               :start, :count ]

      params.each do |k,v|
        if !args.include?(k)
          raise ArgumentError.new 'Search term not allowed: ' + k.to_s
        end
      end

      if params[:count] && params[:count].to_i > 20
        warn 'Count maxes out at 20'
      end

      # these filters are already city-specific
      has_sub_city = params[:establishment_type] || params[:collection_id] || params[:cuisines]

      if (has_sub_city && params[:q]) ||
         (has_sub_city && params[:entity_type] == 'city') ||
         (params[:q] && params[:entity_type] == 'city')
        warn 'More than 2 different kinds of City searches cannot be combined'
      end

      results = get('search', params)
      results['restaurants'].map { |e| Restaurant.new(self, e['restaurant']) }
    end
def restaurants(params={})
      args = [ :entity_id, :entity_type, # location
               :q, :start, :count, :lat, :lon,
               :radius, :cuisines, :establishment_type,
               :collection_id, :category, :sort, :order,
               :start, :count ]

      params.each do |k,v|
        if !args.include?(k)
          raise ArgumentError.new 'Search term not allowed: ' + k.to_s
        end
      end

      if params[:count] && params[:count].to_i > 20
        warn 'Count maxes out at 20'
      end

      # these filters are already city-specific
      has_sub_city = params[:establishment_type] || params[:collection_id] || params[:cuisines]

      if (has_sub_city && params[:q]) ||
         (has_sub_city && params[:entity_type] == 'city') ||
         (params[:q] && params[:entity_type] == 'city')
        warn 'More than 2 different kinds of City searches cannot be combined'
      end

      results = get('search', params)
      results['restaurants'].map { |e| Restaurant.new(self, e['restaurant']) }
    end
general search for restaurants