Class: Renalware::HD::SessionForms::BatchPrintJob
- Inherits:
-
Struct
- Object
- Struct
- Renalware::HD::SessionForms::BatchPrintJob
- Includes:
- UsingTempFolder
- Defined in:
- app/jobs/renalware/hd/session_forms/batch_print_job.rb
Instance Attribute Summary collapse
-
#batch_id ⇒ Object
Returns the value of attribute batch_id.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Instance Method Summary collapse
- #destroy_failed_jobs? ⇒ Boolean
- #max_attempts ⇒ Object
-
#perform ⇒ Object
Returns the name of a temp file containing the pdf data.
- #priority ⇒ Object
- #queue_name ⇒ Object
Methods included from UsingTempFolder
Instance Attribute Details
#batch_id ⇒ Object
Returns the value of attribute 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_id ⇒ Object
Returns the value of attribute 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
34 35 36 |
# File 'app/jobs/renalware/hd/session_forms/batch_print_job.rb', line 34 def destroy_failed_jobs? true end |
#max_attempts ⇒ Object
22 23 24 |
# File 'app/jobs/renalware/hd/session_forms/batch_print_job.rb', line 22 def max_attempts 1 end |
#perform ⇒ Object
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 |
#priority ⇒ Object
30 31 32 |
# File 'app/jobs/renalware/hd/session_forms/batch_print_job.rb', line 30 def priority 0 # high end |
#queue_name ⇒ Object
26 27 28 |
# File 'app/jobs/renalware/hd/session_forms/batch_print_job.rb', line 26 def queue_name "hd_session_forms" end |