class ActiveDelivery::Lines::Notifier
AbstractNotifier
line for Active Delivery.
You must provide custom `resolver` to infer notifier class (if String#safe_constantize is defined, we convert “*Delivery” -> “*Notifier”).
Resolver is a callable object.
Constants
- DEFAULT_RESOLVER
Attributes
resolver[R]
Public Class Methods
new(**opts)
click to toggle source
Calls superclass method
# File lib/active_delivery/lines/notifier.rb, line 14 def initialize(**opts) super @resolver = opts[:resolver] end
Public Instance Methods
notify?(method_name)
click to toggle source
# File lib/active_delivery/lines/notifier.rb, line 23 def notify?(method_name) handler_class.action_methods.include?(method_name.to_s) end
notify_later(handler, mid, *args)
click to toggle source
# File lib/active_delivery/lines/notifier.rb, line 31 def notify_later(handler, mid, *args) handler.public_send(mid, *args).notify_later end
notify_now(handler, mid, *args)
click to toggle source
# File lib/active_delivery/lines/notifier.rb, line 27 def notify_now(handler, mid, *args) handler.public_send(mid, *args).notify_now end
resolve_class(name)
click to toggle source
# File lib/active_delivery/lines/notifier.rb, line 19 def resolve_class(name) resolver&.call(name) end