Class: NotificationWorkers::Partner::MenuSectionsReport
- Inherits:
-
ApplicationWorker
- Object
- ApplicationWorker
- NotificationWorkers::Partner::MenuSectionsReport
- Includes:
- MoneyRails::ActionViewExtension, RollbarSynTokenSetterWorker
- Defined in:
- app/workers/notification_workers/partner/menu_sections_report.rb
Overview
typed: true frozen_string_literal: true
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#date_filter_type ⇒ Object
Returns the value of attribute date_filter_type.
-
#date_from ⇒ Object
Returns the value of attribute date_from.
-
#date_to ⇒ Object
Returns the value of attribute date_to.
-
#emails ⇒ Object
Returns the value of attribute emails.
-
#menu_items_ids ⇒ Object
Returns the value of attribute menu_items_ids.
-
#menu_items_type ⇒ Object
Returns the value of attribute menu_items_type.
-
#pdf_url ⇒ Object
Returns the value of attribute pdf_url.
-
#restaurant_id ⇒ Object
Returns the value of attribute restaurant_id.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Methods inherited from ApplicationWorker
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
9 10 11 |
# File 'app/workers/notification_workers/partner/menu_sections_report.rb', line 9 def date @date end |
#date_filter_type ⇒ Object
Returns the value of attribute date_filter_type.
9 10 11 |
# File 'app/workers/notification_workers/partner/menu_sections_report.rb', line 9 def date_filter_type @date_filter_type end |
#date_from ⇒ Object
Returns the value of attribute date_from.
9 10 11 |
# File 'app/workers/notification_workers/partner/menu_sections_report.rb', line 9 def date_from @date_from end |
#date_to ⇒ Object
Returns the value of attribute date_to.
9 10 11 |
# File 'app/workers/notification_workers/partner/menu_sections_report.rb', line 9 def date_to @date_to end |
#emails ⇒ Object
Returns the value of attribute emails.
9 10 11 |
# File 'app/workers/notification_workers/partner/menu_sections_report.rb', line 9 def emails @emails end |
#menu_items_ids ⇒ Object
Returns the value of attribute menu_items_ids.
9 10 11 |
# File 'app/workers/notification_workers/partner/menu_sections_report.rb', line 9 def @menu_items_ids end |
#menu_items_type ⇒ Object
Returns the value of attribute menu_items_type.
9 10 11 |
# File 'app/workers/notification_workers/partner/menu_sections_report.rb', line 9 def @menu_items_type end |
#pdf_url ⇒ Object
Returns the value of attribute pdf_url.
9 10 11 |
# File 'app/workers/notification_workers/partner/menu_sections_report.rb', line 9 def pdf_url @pdf_url end |
#restaurant_id ⇒ Object
Returns the value of attribute restaurant_id.
9 10 11 |
# File 'app/workers/notification_workers/partner/menu_sections_report.rb', line 9 def restaurant_id @restaurant_id end |
#type ⇒ Object
Returns the value of attribute type.
9 10 11 |
# File 'app/workers/notification_workers/partner/menu_sections_report.rb', line 9 def type @type end |
Instance Method Details
#perform(args) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/workers/notification_workers/partner/menu_sections_report.rb', line 15 def perform(args) begin args.to_h.with_indifferent_access.each do |k, v| next if k.to_s == :use_long_process.to_s send("#{k}=".to_sym, v) end I18n.locale = :en = if pdf? report = MenuSectionsReportPdf.new() report.generate_pdf(, args) self.pdf_url = report.pdf_url else self. = end OwnerMailer.(email_body, email_subject, emails).deliver_later! rescue StandardError => e APMErrorHandler.report e raise e end end |