Class: DelayedPaperclip::Jobs::DelayedJob

Inherits:
Struct
  • Object
show all
Defined in:
lib/delayed_paperclip/jobs/delayed_job.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attachment_nameObject

Returns the value of attribute attachment_name

Returns:

  • (Object)

    the current value of attachment_name



5
6
7
# File 'lib/delayed_paperclip/jobs/delayed_job.rb', line 5

def attachment_name
  @attachment_name
end

#instance_idObject

Returns the value of attribute instance_id

Returns:

  • (Object)

    the current value of instance_id



5
6
7
# File 'lib/delayed_paperclip/jobs/delayed_job.rb', line 5

def instance_id
  @instance_id
end

#instance_klassObject

Returns the value of attribute instance_klass

Returns:

  • (Object)

    the current value of instance_klass



5
6
7
# File 'lib/delayed_paperclip/jobs/delayed_job.rb', line 5

def instance_klass
  @instance_klass
end

Class Method Details

.enqueue_delayed_paperclip(instance_klass, instance_id, attachment_name) ⇒ Object



9
10
11
12
13
14
# File 'lib/delayed_paperclip/jobs/delayed_job.rb', line 9

def self.enqueue_delayed_paperclip(instance_klass, instance_id, attachment_name)
  ::Delayed::Job.enqueue(
    :payload_object => new(instance_klass, instance_id, attachment_name),
    :priority => instance_klass.constantize.attachment_definitions[attachment_name][:delayed][:priority].to_i
  )
end

Instance Method Details

#performObject



27
28
29
# File 'lib/delayed_paperclip/jobs/delayed_job.rb', line 27

def perform
  DelayedPaperclip.process_job(instance_klass, instance_id, attachment_name)
end