Class: GenerateReportJob

Inherits:
Struct
  • Object
show all
Defined in:
app/jobs/generate_report_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#report_idObject

Returns the value of attribute report_id

Returns:

  • (Object)

    the current value of report_id



1
2
3
# File 'app/jobs/generate_report_job.rb', line 1

def report_id
  @report_id
end

#requeueObject

Returns the value of attribute requeue

Returns:

  • (Object)

    the current value of requeue



1
2
3
# File 'app/jobs/generate_report_job.rb', line 1

def requeue
  @requeue
end

Instance Method Details

#performObject



7
8
9
10
11
# File 'app/jobs/generate_report_job.rb', line 7

def perform
  return if report.nil?
  report.generate!
  report.queue_next! if requeue
end

#reportObject



3
4
5
# File 'app/jobs/generate_report_job.rb', line 3

def report
  @report ||= Report.find_by_id(report_id)
end