Class: Spotlight::SearchState

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/spotlight/search_state.rb

Overview

Override Blacklight::SearchState to use exhibit-specific routes for documents

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(search_state, current_exhibit) ⇒ SearchState

Returns a new instance of SearchState.



8
9
10
11
# File 'lib/spotlight/search_state.rb', line 8

def initialize(search_state, current_exhibit)
  super(search_state)
  @current_exhibit = current_exhibit
end

Instance Attribute Details

#current_exhibitObject (readonly)

Returns the value of attribute current_exhibit.



6
7
8
# File 'lib/spotlight/search_state.rb', line 6

def current_exhibit
  @current_exhibit
end

Instance Method Details

#url_for_document(document, options = {}) ⇒ Object



13
14
15
16
17
# File 'lib/spotlight/search_state.rb', line 13

def url_for_document(document, options = {})
  return super unless current_exhibit

  [controller.spotlight, current_exhibit, document]
end