Class: Que::Testing::Adapter

Inherits:
Adapters::Base
  • Object
show all
Defined in:
lib/que/testing/adapter.rb

Instance Method Summary collapse

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

#jobsObject



27
28
29
# File 'lib/que/testing/adapter.rb', line 27

def jobs
  @jobs ||= Hash.new { |h,k| h[k] = [] }
end

#wake_worker_after_commitObject



19
20
21
# File 'lib/que/testing/adapter.rb', line 19

def wake_worker_after_commit
  false
end