Class: Waistband::FreeQuery
- Inherits:
-
Object
- Object
- Waistband::FreeQuery
- Includes:
- QueryHelpers
- Defined in:
- lib/waistband/free_query.rb
Instance Attribute Summary collapse
-
#page ⇒ Object
Returns the value of attribute page.
-
#page_size ⇒ Object
Returns the value of attribute page_size.
Instance Method Summary collapse
-
#initialize(index, options = {}) ⇒ FreeQuery
constructor
A new instance of FreeQuery.
- #prepare(hash) ⇒ Object
Methods included from QueryHelpers
#hits, #paginated_results, #results, #total_results
Constructor Details
#initialize(index, options = {}) ⇒ FreeQuery
Returns a new instance of FreeQuery.
10 11 12 13 14 |
# File 'lib/waistband/free_query.rb', line 10 def initialize(index, = {}) @index = index @page = ([:page] || 1).to_i @page_size = ([:page_size] || 20).to_i end |
Instance Attribute Details
#page ⇒ Object
Returns the value of attribute page.
8 9 10 |
# File 'lib/waistband/free_query.rb', line 8 def page @page end |
#page_size ⇒ Object
Returns the value of attribute page_size.
8 9 10 |
# File 'lib/waistband/free_query.rb', line 8 def page_size @page_size end |
Instance Method Details
#prepare(hash) ⇒ Object
16 17 18 |
# File 'lib/waistband/free_query.rb', line 16 def prepare(hash) @hash = hash.with_indifferent_access end |