Class: Qmin::Resque::BackgroundCallJob

Inherits:
Object
  • Object
show all
Defined in:
lib/qmin/resque/background_call_job.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, method_name, id) ⇒ BackgroundCallJob

Returns a new instance of BackgroundCallJob.



9
10
11
12
13
# File 'lib/qmin/resque/background_call_job.rb', line 9

def initialize(klass, method_name, id)
  @klass = klass.is_a?(Class) ? klass : klass.constantize
  @method_name = method_name
  @id = id
end

Class Method Details

.perform(*args) ⇒ Object



5
6
7
# File 'lib/qmin/resque/background_call_job.rb', line 5

def self.perform(*args)
  new(*args).perform
end

Instance Method Details

#performObject



15
16
17
18
# File 'lib/qmin/resque/background_call_job.rb', line 15

def perform
  instance = @klass.find(@id)
  instance.send(::Qmin.method_name_for_instance(instance, @method_name))
end