Class: Mediate::NotificationHandler Abstract
- Inherits:
-
Object
- Object
- Mediate::NotificationHandler
- Defined in:
- lib/mediate/notification_handler.rb
Overview
This class is abstract.
override #handle to implement.
Abstract base class of a handler of notifications.
Class Method Summary collapse
-
.handles(notif_class = Mediate::Notification, mediator = Mediate.mediator) ⇒ void
Registers this handler for the given notification Class.
Instance Method Summary collapse
-
#handle(_notification) ⇒ void
abstract
The method to implement that handles the notifications registered for this handler.
Class Method Details
.handles(notif_class = Mediate::Notification, mediator = Mediate.mediator) ⇒ void
This method returns an undefined value.
Registers this handler for the given notification Class.
The notification Class must have Mediate::Notification as a superclass.
21 22 23 |
# File 'lib/mediate/notification_handler.rb', line 21 def self.handles(notif_class = Mediate::Notification, mediator = Mediate.mediator) mediator.register_notification_handler(self, notif_class) end |
Instance Method Details
#handle(_notification) ⇒ void
This method is abstract.
This method returns an undefined value.
The method to implement that handles the notifications registered for this handler.
34 35 36 |
# File 'lib/mediate/notification_handler.rb', line 34 def handle(_notification) raise NoMethodError, "handle must be implemented" end |