Class: Twterm::NotificationDispatcher
- Inherits:
-
Object
- Object
- Twterm::NotificationDispatcher
- Includes:
- Subscriber
- Defined in:
- lib/twterm/notification_dispatcher.rb
Instance Method Summary collapse
-
#initialize(preferences) ⇒ NotificationDispatcher
constructor
A new instance of NotificationDispatcher.
Methods included from Subscriber
included, #subscribe, #unsubscribe
Constructor Details
#initialize(preferences) ⇒ NotificationDispatcher
Returns a new instance of NotificationDispatcher.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/twterm/notification_dispatcher.rb', line 12 def initialize(preferences) @preferences = preferences @backends = { inline: NotificationBackend::InlineBackend.new, terminal_notifier: NotificationBackend::TerminalNotifierBackend.new, tmux: NotificationBackend::TmuxBackend.new, } subscribe(Event::Notification::AbstractNotification) { |n| dispatch(n) } end |