Class: Dalliance::Workers::DelayedJob

Inherits:
Struct
  • Object
show all
Defined in:
lib/dalliance/workers/delayed_job.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#instance_idObject

Returns the value of attribute instance_id

Returns:

  • (Object)

    the current value of instance_id



3
4
5
# File 'lib/dalliance/workers/delayed_job.rb', line 3

def instance_id
  @instance_id
end

#instance_klassObject

Returns the value of attribute instance_klass

Returns:

  • (Object)

    the current value of instance_klass



3
4
5
# File 'lib/dalliance/workers/delayed_job.rb', line 3

def instance_klass
  @instance_klass
end

Class Method Details

.enqueue(instance) ⇒ Object



4
5
6
# File 'lib/dalliance/workers/delayed_job.rb', line 4

def self.enqueue(instance)
  ::Delayed::Job.enqueue(self.new(instance.class.name, instance.id), :queue => 'dalliance')
end

Instance Method Details

#performObject



8
9
10
# File 'lib/dalliance/workers/delayed_job.rb', line 8

def perform
  instance_klass.constantize.find(instance_id).dalliance_process(true)
end