Class: NotificationService::Async

Inherits:
Object
  • Object
show all
Defined in:
app/services/notification_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ Async

Returns a new instance of Async.


24
25
26
# File 'app/services/notification_service.rb', line 24

def initialize(parent)
  @parent = parent
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object


28
29
30
31
32
# File 'app/services/notification_service.rb', line 28

def method_missing(meth, *args)
  return super unless parent.respond_to?(meth)

  MailScheduler::NotificationServiceWorker.perform_async(meth.to_s, *args)
end

Instance Attribute Details

#parentObject (readonly)

Returns the value of attribute parent.


20
21
22
# File 'app/services/notification_service.rb', line 20

def parent
  @parent
end