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.



34
35
36
# File 'app/services/notification_service.rb', line 34

def initialize(parent)
  @parent = parent
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



38
39
40
41
42
# File 'app/services/notification_service.rb', line 38

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.



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

def parent
  @parent
end