Class: Searchlight::Search
- Inherits:
-
Object
- Object
- Searchlight::Search
- Extended by:
- Adapters::ActionView::ClassMethods, Adapters::ActiveRecord, DSL
- Defined in:
- lib/searchlight/search.rb
Defined Under Namespace
Classes: UndefinedOption
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
- #search ⇒ Object readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Search
constructor
A new instance of Search.
- #results ⇒ Object
Methods included from DSL
Methods included from Adapters::ActionView::ClassMethods
Methods included from Adapters::ActiveRecord
Constructor Details
#initialize(options = {}) ⇒ Search
Returns a new instance of Search.
13 14 15 |
# File 'lib/searchlight/search.rb', line 13 def initialize( = {}) filter_and_mass_assign() end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/searchlight/search.rb', line 5 def @options end |
#search ⇒ Object
17 18 19 |
# File 'lib/searchlight/search.rb', line 17 def search @search ||= self.class.search_target end |
Class Method Details
.search_target ⇒ Object
7 8 9 10 11 |
# File 'lib/searchlight/search.rb', line 7 def self.search_target return @search_target if defined?(@search_target) return superclass.search_target if superclass.respond_to?(:search_target) && superclass != Searchlight::Search guess_search_class! end |
Instance Method Details
#results ⇒ Object
21 22 23 |
# File 'lib/searchlight/search.rb', line 21 def results @results ||= run end |