Class: Spree::Core::Search::Base
- Inherits:
-
Object
- Object
- Spree::Core::Search::Base
- Defined in:
- lib/spree/core/search/base.rb
Instance Attribute Summary collapse
-
#properties ⇒ Object
Returns the value of attribute properties.
Instance Method Summary collapse
-
#initialize(params) ⇒ Base
constructor
A new instance of Base.
- #method_missing(name) ⇒ Object
- #retrieve_products ⇒ Object
Constructor Details
#initialize(params) ⇒ Base
Returns a new instance of Base.
7 8 9 10 |
# File 'lib/spree/core/search/base.rb', line 7 def initialize(params) @properties = {} prepare(params) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/spree/core/search/base.rb', line 19 def method_missing(name) if @properties.has_key? name @properties[name] else super end end |
Instance Attribute Details
#properties ⇒ Object
Returns the value of attribute properties.
5 6 7 |
# File 'lib/spree/core/search/base.rb', line 5 def properties @properties end |
Instance Method Details
#retrieve_products ⇒ Object
12 13 14 15 16 17 |
# File 'lib/spree/core/search/base.rb', line 12 def retrieve_products @products_scope = get_base_scope curr_page = page || 1 @products = @products_scope.includes([:master]).page(curr_page).per(per_page) end |