Class: NotificationWorker

Inherits:
Object
  • Object
show all
Defined in:
app/workers/notification_worker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject

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_nameObject



2
3
4
# File 'app/workers/notification_worker.rb', line 2

def queue_name
  :help_request_notifications
end

#runObject



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