Class: Gitlab::EmptySearchResults

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/empty_search_results.rb

Overview

This class has the same interface as SearchResults except it is empty and does not do any work.

We use this when responding to abusive search requests.

Instance Method Summary collapse

Constructor Details

#initializeEmptySearchResults

Returns a new instance of EmptySearchResults.



9
10
# File 'lib/gitlab/empty_search_results.rb', line 9

def initialize(*)
end

Instance Method Details

#aggregationsObject



24
25
26
# File 'lib/gitlab/empty_search_results.rb', line 24

def aggregations(*)
  []
end

#formatted_countObject



16
17
18
# File 'lib/gitlab/empty_search_results.rb', line 16

def formatted_count(*)
  '0'
end

#highlight_mapObject



20
21
22
# File 'lib/gitlab/empty_search_results.rb', line 20

def highlight_map(*)
  {}
end

#objectsObject



12
13
14
# File 'lib/gitlab/empty_search_results.rb', line 12

def objects(*)
  Kaminari.paginate_array([])
end