Class: Spree::Search::Base
- Inherits:
-
Object
- Object
- Spree::Search::Base
- Defined in:
- lib/spree/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.
5 6 7 8 |
# File 'lib/spree/search/base.rb', line 5 def initialize(params) @properties = {} prepare(params) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
22 23 24 |
# File 'lib/spree/search/base.rb', line 22 def method_missing(name) @properties[name] end |
Instance Attribute Details
#properties ⇒ Object
Returns the value of attribute properties.
3 4 5 |
# File 'lib/spree/search/base.rb', line 3 def properties @properties end |
Instance Method Details
#retrieve_products ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/spree/search/base.rb', line 10 def retrieve_products base_scope = get_base_scope @products_scope = @product_group.apply_on(base_scope) curr_page = manage_pagination && keywords ? 1 : page @products = @products_scope.paginate({ :include => [:images, :master], :per_page => per_page, :page => curr_page }) end |