Class: Blacklight::Response::SpellcheckComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Blacklight::Response::SpellcheckComponent
- Defined in:
- app/components/blacklight/response/spellcheck_component.rb
Overview
Render spellcheck results for a search query
Instance Method Summary collapse
-
#initialize(response:, options: nil) ⇒ SpellcheckComponent
constructor
A new instance of SpellcheckComponent.
- #link_to_query(query) ⇒ Object
- #render? ⇒ Boolean
Methods inherited from Component
reset_compiler!, sidecar_files, upstream_sidecar_files
Constructor Details
#initialize(response:, options: nil) ⇒ SpellcheckComponent
Returns a new instance of SpellcheckComponent.
9 10 11 12 13 |
# File 'app/components/blacklight/response/spellcheck_component.rb', line 9 def initialize(response:, options: nil) @response = response @options = @options ||= (@response) end |
Instance Method Details
#link_to_query(query) ⇒ Object
15 16 17 18 19 |
# File 'app/components/blacklight/response/spellcheck_component.rb', line 15 def link_to_query(query) Deprecation.silence(Blacklight::UrlHelperBehavior) do helpers.link_to_query(query) end end |
#render? ⇒ Boolean
21 22 23 24 25 |
# File 'app/components/blacklight/response/spellcheck_component.rb', line 21 def render? Deprecation.silence(Blacklight::BlacklightHelperBehavior) do @options&.any? && helpers.should_show_spellcheck_suggestions?(@response) end end |