Class: Blacklight::SuggestSearch

Inherits:
Object
  • Object
show all
Defined in:
app/models/blacklight/suggest_search.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params, repository) ⇒ SuggestSearch

Returns a new instance of SuggestSearch.

Parameters:



10
11
12
13
# File 'app/models/blacklight/suggest_search.rb', line 10

def initialize(params, repository)
  @request_params = { q: params[:q] }
  @repository = repository
end

Instance Attribute Details

#repositoryObject (readonly)

Returns the value of attribute repository.



5
6
7
# File 'app/models/blacklight/suggest_search.rb', line 5

def repository
  @repository
end

#request_paramsObject (readonly)

Returns the value of attribute request_params.



5
6
7
# File 'app/models/blacklight/suggest_search.rb', line 5

def request_params
  @request_params
end

Instance Method Details

#suggestionsBlacklight::Suggest::Response

For now, only use the q parameter to create a Blacklight::Suggest::Response



19
20
21
# File 'app/models/blacklight/suggest_search.rb', line 19

def suggestions
  repository.suggestions(request_params)
end