Class: GenerateReportJob
- Inherits:
-
Struct
- Object
- Struct
- GenerateReportJob
- Defined in:
- app/jobs/generate_report_job.rb
Instance Attribute Summary collapse
-
#report_id ⇒ Object
Returns the value of attribute report_id.
-
#requeue ⇒ Object
Returns the value of attribute requeue.
Instance Method Summary collapse
Instance Attribute Details
#report_id ⇒ Object
Returns the value of attribute report_id
1 2 3 |
# File 'app/jobs/generate_report_job.rb', line 1 def report_id @report_id end |
#requeue ⇒ Object
Returns the value of attribute requeue
1 2 3 |
# File 'app/jobs/generate_report_job.rb', line 1 def requeue @requeue end |
Instance Method Details
#enqueue(job) ⇒ Object
3 4 5 |
# File 'app/jobs/generate_report_job.rb', line 3 def enqueue(job) job.report_id = self.report_id end |
#perform ⇒ Object
11 12 13 14 15 16 |
# File 'app/jobs/generate_report_job.rb', line 11 def perform return if report.nil? return if report.archived? report.generate! report.queue_next! if requeue end |
#report ⇒ Object
7 8 9 |
# File 'app/jobs/generate_report_job.rb', line 7 def report @daily_report ||= DailyReport.find_by_id(report_id) end |