module ElasticQueue::Queueable::ClassMethods

Public Instance Methods

all_queue_attributes() click to toggle source

the union of analyzed and not_analyzed attributes

# File lib/elastic_queue/queueable.rb, line 25
def all_queue_attributes
  @queue_attributes.to_a | @not_analyzed_queue_attributes.to_a
end
analyzed_queue_attributes(*attributes)
Alias for: queue_attributes
not_analyzed_queue_attributes(*attributes) click to toggle source
# File lib/elastic_queue/queueable.rb, line 20
def not_analyzed_queue_attributes(*attributes)
  @not_analyzed_queue_attributes ||= attributes
end
queue_attributes(*attributes) click to toggle source
# File lib/elastic_queue/queueable.rb, line 14
def queue_attributes(*attributes)
  @queue_attributes ||= attributes
end
Also aliased as: analyzed_queue_attributes
queue_classes() click to toggle source
# File lib/elastic_queue/queueable.rb, line 10
def queue_classes
  queues.map { |q| q.to_s.camelize.constantize }
end
queue_mapping() click to toggle source
# File lib/elastic_queue/queueable.rb, line 29
def queue_mapping
  return if @not_analyzed_queue_attributes.blank?
  properties = {}
  @not_analyzed_queue_attributes.each do |a|
    properties[a.to_sym] = { type: :string, index: :not_analyzed }
  end
  { to_s.underscore.to_sym => { properties: properties } }
end
queues(*queues) click to toggle source
# File lib/elastic_queue/queueable.rb, line 6
def queues(*queues)
  @queues ||= queues
end