Class: Mongoid::Haystack::Denormalization::Results

Inherits:
Array
  • Object
show all
Includes:
Pagination
Defined in:
lib/mongoid-haystack/search.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Pagination

#_paginated, #method_missing, #paginate

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Mongoid::Haystack::Pagination

Instance Attribute Details

#queryObject

Returns the value of attribute query.



206
207
208
# File 'lib/mongoid-haystack/search.rb', line 206

def query
  @query
end

Class Method Details

.for(query) ⇒ Object



208
209
210
211
212
213
214
# File 'lib/mongoid-haystack/search.rb', line 208

def Results.for(query)
  Results.new.tap do |results|
    results.query = query
    results.replace(query._denormalized)
    results._paginated.replace(query._paginated) rescue nil
  end
end

Instance Method Details

#modelsObject



216
217
218
# File 'lib/mongoid-haystack/search.rb', line 216

def models
  self
end