Class: Blacklight::SuggestSearch
- Inherits:
-
Object
- Object
- Blacklight::SuggestSearch
- Defined in:
- app/models/blacklight/suggest_search.rb
Instance Attribute Summary collapse
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#request_params ⇒ Object
readonly
Returns the value of attribute request_params.
Instance Method Summary collapse
-
#initialize(params, repository) ⇒ SuggestSearch
constructor
A new instance of SuggestSearch.
-
#suggestions ⇒ Blacklight::Suggest::Response
For now, only use the q parameter to create a Blacklight::Suggest::Response.
Constructor Details
#initialize(params, repository) ⇒ SuggestSearch
Returns a new instance of SuggestSearch.
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
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
5 6 7 |
# File 'app/models/blacklight/suggest_search.rb', line 5 def repository @repository end |
#request_params ⇒ Object (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
#suggestions ⇒ Blacklight::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 |