Module: RSolr::Ext::Model::Findable
- Defined in:
- lib/rsolr-ext/model.rb
Overview
Findable is a module that gets mixed into the SolrDocument class object. These methods will be available through the class like: SolrDocument.find and SolrDocument.find_by_id
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#default_params ⇒ Object
Returns the value of attribute default_params.
Instance Method Summary collapse
-
#find(*args) ⇒ Object
this method decorates the connection find method and then creates new instance of the class that uses this module.
-
#find_by_id(id, solr_params = {}, opts = {}) ⇒ Object
this method decorates the connection find_by_id method and then creates new instance of the class that uses this module.
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
44 45 46 |
# File 'lib/rsolr-ext/model.rb', line 44 def connection @connection end |
#default_params ⇒ Object
Returns the value of attribute default_params.
44 45 46 |
# File 'lib/rsolr-ext/model.rb', line 44 def default_params @default_params end |
Instance Method Details
#find(*args) ⇒ Object
this method decorates the connection find method and then creates new instance of the class that uses this module.
52 53 54 |
# File 'lib/rsolr-ext/model.rb', line 52 def find(*args) decorate_response_docs connection.find(*args) end |
#find_by_id(id, solr_params = {}, opts = {}) ⇒ Object
this method decorates the connection find_by_id method and then creates new instance of the class that uses this module.
58 59 60 |
# File 'lib/rsolr-ext/model.rb', line 58 def find_by_id(id, solr_params={}, opts={}) decorate_response_docs connection.find_by_id(id, solr_params, opts) end |