Class: RestaurantListWorker

Inherits:
ApplicationWorker show all
Defined in:
app/workers/restaurant_list_worker.rb

Overview

typed: true

Instance Method Summary collapse

Methods inherited from ApplicationWorker

unlimited_retry

Instance Method Details

#perform(emails) ⇒ Object



4
5
6
7
8
9
10
# File 'app/workers/restaurant_list_worker.rb', line 4

def perform(emails)
  @attachment = Attachment.new
  @file_path = Rails.root.join('tmp', "restaurant-report-#{rand(100_000)}#{Time.zone.now.to_i}.xls")
  generate_xls_report
  generate_attachment
  send_email(emails)
end