Class: BlacklightIiifSearch::IiifSearch
- Inherits:
-
Object
- Object
- BlacklightIiifSearch::IiifSearch
- Includes:
- SearchBehavior
- Defined in:
- app/models/blacklight_iiif_search/iiif_search.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#iiif_config ⇒ Object
readonly
Returns the value of attribute iiif_config.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#parent_document ⇒ Object
readonly
Returns the value of attribute parent_document.
-
#q ⇒ Object
readonly
Returns the value of attribute q.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
Instance Method Summary collapse
-
#initialize(params, iiif_search_config, parent_document) ⇒ IiifSearch
constructor
A new instance of IiifSearch.
-
#solr_params ⇒ Hash
return a hash of Solr search params if q is not supplied, have to pass some dummy params or else all records matching object_relation_solr_params are returned.
Methods included from SearchBehavior
Constructor Details
#initialize(params, iiif_search_config, parent_document) ⇒ IiifSearch
Returns a new instance of IiifSearch.
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/models/blacklight_iiif_search/iiif_search.rb', line 14 def initialize(params, iiif_search_config, parent_document) @id = params[:solr_document_id] @iiif_config = iiif_search_config @parent_document = parent_document @q = params[:q] @page = params[:page] @rows = 50 # NOT IMPLEMENTED YET # @motivation = params[:motivation] # @date = params[:date] # @user = params[:user] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'app/models/blacklight_iiif_search/iiif_search.rb', line 8 def id @id end |
#iiif_config ⇒ Object (readonly)
Returns the value of attribute iiif_config.
8 9 10 |
# File 'app/models/blacklight_iiif_search/iiif_search.rb', line 8 def iiif_config @iiif_config end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
8 9 10 |
# File 'app/models/blacklight_iiif_search/iiif_search.rb', line 8 def page @page end |
#parent_document ⇒ Object (readonly)
Returns the value of attribute parent_document.
8 9 10 |
# File 'app/models/blacklight_iiif_search/iiif_search.rb', line 8 def parent_document @parent_document end |
#q ⇒ Object (readonly)
Returns the value of attribute q.
8 9 10 |
# File 'app/models/blacklight_iiif_search/iiif_search.rb', line 8 def q @q end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
8 9 10 |
# File 'app/models/blacklight_iiif_search/iiif_search.rb', line 8 def rows @rows end |
Instance Method Details
#solr_params ⇒ Hash
return a hash of Solr search params if q is not supplied, have to pass some dummy params or else all records matching object_relation_solr_params are returned
33 34 35 36 |
# File 'app/models/blacklight_iiif_search/iiif_search.rb', line 33 def solr_params return { q: 'nil:nil' } unless q { q: q, f: object_relation_solr_params, rows: rows, page: page } end |