Class: Renalware::HD::SessionForms::BatchPrintJob

Inherits:
Struct
  • Object
show all
Includes:
UsingTempFolder
Defined in:
app/jobs/renalware/hd/session_forms/batch_print_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from UsingTempFolder

#in_a_temporary_folder

Instance Attribute Details

#batch_idObject

Returns the value of attribute batch_id

Returns:

  • (Object)

    the current value of batch_id



8
9
10
# File 'app/jobs/renalware/hd/session_forms/batch_print_job.rb', line 8

def batch_id
  @batch_id
end

#user_idObject

Returns the value of attribute user_id

Returns:

  • (Object)

    the current value of user_id



8
9
10
# File 'app/jobs/renalware/hd/session_forms/batch_print_job.rb', line 8

def user_id
  @user_id
end

Instance Method Details

#destroy_failed_jobs?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'app/jobs/renalware/hd/session_forms/batch_print_job.rb', line 34

def destroy_failed_jobs?
  true
end

#max_attemptsObject



22
23
24
# File 'app/jobs/renalware/hd/session_forms/batch_print_job.rb', line 22

def max_attempts
  1
end

#performObject

Returns the name of a temp file containing the pdf data



12
13
14
15
16
17
18
19
20
# File 'app/jobs/renalware/hd/session_forms/batch_print_job.rb', line 12

def perform
  in_a_temporary_folder do |dir|
    Dir.chdir(dir) do
      batch = Batch.find(batch_id)
      user = User.find(user_id)
      BatchCompilePdfs.call(batch, user)
    end
  end
end

#priorityObject



30
31
32
# File 'app/jobs/renalware/hd/session_forms/batch_print_job.rb', line 30

def priority
  0 # high
end

#queue_nameObject



26
27
28
# File 'app/jobs/renalware/hd/session_forms/batch_print_job.rb', line 26

def queue_name
  "hd_session_forms"
end