Class: SearchAndResque::Queue
- Inherits:
-
Object
- Object
- SearchAndResque::Queue
- Defined in:
- lib/search_and_resque/queue.rb
Class Attribute Summary collapse
-
.queue ⇒ Object
Returns the value of attribute queue.
Class Method Summary collapse
- .enqueue_delete(type_name, ids) ⇒ Object
- .enqueue_update(type_name, ids) ⇒ Object
- .perform(type_name, action, ids) ⇒ Object
Class Attribute Details
.queue ⇒ Object
Returns the value of attribute queue.
4 5 6 |
# File 'lib/search_and_resque/queue.rb', line 4 def queue @queue end |
Class Method Details
.enqueue_delete(type_name, ids) ⇒ Object
18 19 20 21 22 |
# File 'lib/search_and_resque/queue.rb', line 18 def self.enqueue_delete(type_name, ids) unless ids.empty? Resque.enqueue(self, type_name, :delete!, ids) end end |
.enqueue_update(type_name, ids) ⇒ Object
12 13 14 15 16 |
# File 'lib/search_and_resque/queue.rb', line 12 def self.enqueue_update(type_name, ids) unless ids.empty? Resque.enqueue(self, type_name, :import!, ids) end end |
.perform(type_name, action, ids) ⇒ Object
7 8 9 10 |
# File 'lib/search_and_resque/queue.rb', line 7 def self.perform(type_name, action, ids) type = SearchAndResque.index.types.find{ |t| t.type_name == type_name } type.send(action, ids) end |