Module: ElasticQueue::Queueable::ClassMethods
- Defined in:
- lib/elastic_queue/queueable.rb
Instance Method Summary collapse
-
#all_queue_attributes ⇒ Object
the union of analyzed and not_analyzed attributes.
- #not_analyzed_queue_attributes(*attributes) ⇒ Object
- #queue_attributes(*attributes) ⇒ Object (also: #analyzed_queue_attributes)
- #queue_classes ⇒ Object
- #queue_mapping ⇒ Object
- #queues(*queues) ⇒ Object
Instance Method Details
#all_queue_attributes ⇒ Object
the union of analyzed and not_analyzed attributes
32 33 34 |
# File 'lib/elastic_queue/queueable.rb', line 32 def all_queue_attributes @queue_attributes.to_a | @not_analyzed_queue_attributes.to_a end |
#not_analyzed_queue_attributes(*attributes) ⇒ Object
27 28 29 |
# File 'lib/elastic_queue/queueable.rb', line 27 def not_analyzed_queue_attributes(*attributes) @not_analyzed_queue_attributes ||= attributes end |
#queue_attributes(*attributes) ⇒ Object Also known as: analyzed_queue_attributes
21 22 23 |
# File 'lib/elastic_queue/queueable.rb', line 21 def queue_attributes(*attributes) @queue_attributes ||= attributes end |
#queue_classes ⇒ Object
17 18 19 |
# File 'lib/elastic_queue/queueable.rb', line 17 def queue_classes queues.map { |q| q.to_s.camelize.constantize } end |
#queue_mapping ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/elastic_queue/queueable.rb', line 36 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) ⇒ Object
13 14 15 |
# File 'lib/elastic_queue/queueable.rb', line 13 def queues(*queues) @queues ||= queues end |