Module: ElasticQueue::Percolation

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/elastic_queue/percolation.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#in_queue?(model) ⇒ Boolean

Returns:

  • (Boolean)


36
37
38
39
# File 'lib/elastic_queue/percolation.rb', line 36

def in_queue?(model)
  search = self.class.dynamically_percolate(model, @query.percolator_body)
  search['matches'].length == 1
end

#register_as_percolator_query(name) ⇒ Object



41
42
43
# File 'lib/elastic_queue/percolation.rb', line 41

def register_as_percolator_query(name)
  self.class.register_percolator_query(name, @query.percolator_body)
end