Class: Que::Testing::Adapter
- Inherits:
-
Adapters::Base
- Object
- Adapters::Base
- Que::Testing::Adapter
- Defined in:
- lib/que/testing/adapter.rb
Instance Method Summary collapse
- #checkout(&block) ⇒ Object
- #class_for(str) ⇒ Object
- #execute(command, params = []) ⇒ Object
- #jobs ⇒ Object
- #wake_worker_after_commit ⇒ Object
Instance Method Details
#checkout(&block) ⇒ Object
7 8 |
# File 'lib/que/testing/adapter.rb', line 7 def checkout(&block) end |
#class_for(str) ⇒ Object
23 24 25 |
# File 'lib/que/testing/adapter.rb', line 23 def class_for(str) str.split('::').reduce(Object, &:const_get) end |
#execute(command, params = []) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/que/testing/adapter.rb', line 10 def execute(command, params = []) return [] unless command == :insert_job job = JobParams.new(*params) klass = class_for(job.job_class) jobs[klass] << job params end |
#jobs ⇒ Object
27 28 29 |
# File 'lib/que/testing/adapter.rb', line 27 def jobs @jobs ||= Hash.new { |h,k| h[k] = [] } end |
#wake_worker_after_commit ⇒ Object
19 20 21 |
# File 'lib/que/testing/adapter.rb', line 19 def wake_worker_after_commit false end |