Class: NotificationWorker
- Inherits:
-
Object
- Object
- NotificationWorker
- Defined in:
- app/workers/notification_worker.rb
Instance Attribute Summary collapse
-
#help_request_id ⇒ Object
Returns the value of attribute help_request_id.
Instance Method Summary collapse
-
#initialize(help_request_id) ⇒ NotificationWorker
constructor
A new instance of NotificationWorker.
- #queue_name ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(help_request_id) ⇒ NotificationWorker
Returns a new instance of NotificationWorker.
8 9 10 |
# File 'app/workers/notification_worker.rb', line 8 def initialize(help_request_id) self.help_request_id = help_request_id end |
Instance Attribute Details
#help_request_id ⇒ Object
Returns the value of attribute help_request_id.
6 7 8 |
# File 'app/workers/notification_worker.rb', line 6 def help_request_id @help_request_id end |
Instance Method Details
#queue_name ⇒ Object
2 3 4 |
# File 'app/workers/notification_worker.rb', line 2 def queue_name :help_request_notifications end |
#run ⇒ Object
12 13 14 15 |
# File 'app/workers/notification_worker.rb', line 12 def run help_request = HelpRequest.find(help_request_id) NotificationMailer.notify(help_request).deliver end |