Class: Sunspot::Queue::Resque::Backend
- Inherits:
-
Object
- Object
- Sunspot::Queue::Resque::Backend
- Defined in:
- lib/sunspot/queue/resque/backend.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Instance Method Summary collapse
- #enqueue(job, klass, id) ⇒ Object
- #index(klass, id) ⇒ Object
-
#initialize(configuration = Sunspot::Queue.configuration) ⇒ Backend
constructor
A new instance of Backend.
- #remove(klass, id) ⇒ Object
Constructor Details
#initialize(configuration = Sunspot::Queue.configuration) ⇒ Backend
Returns a new instance of Backend.
9 10 11 |
# File 'lib/sunspot/queue/resque/backend.rb', line 9 def initialize(configuration = Sunspot::Queue.configuration) @configuration = configuration end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
7 8 9 |
# File 'lib/sunspot/queue/resque/backend.rb', line 7 def configuration @configuration end |
Instance Method Details
#enqueue(job, klass, id) ⇒ Object
13 14 15 |
# File 'lib/sunspot/queue/resque/backend.rb', line 13 def enqueue(job, klass, id) ::Resque.enqueue(job, klass, id) end |
#index(klass, id) ⇒ Object
17 18 19 |
# File 'lib/sunspot/queue/resque/backend.rb', line 17 def index(klass, id) enqueue(index_job, klass, id) end |
#remove(klass, id) ⇒ Object
21 22 23 |
# File 'lib/sunspot/queue/resque/backend.rb', line 21 def remove(klass, id) enqueue(removal_job, klass, id) end |