Class: Twterm::NotificationBackend::TerminalNotifierBackend

Inherits:
AbstractNotificationBackend show all
Defined in:
lib/twterm/notification_backend/terminal_notifier_backend.rb

Instance Method Summary collapse

Instance Method Details

#notify(notification) ⇒ Object

Parameters:



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/twterm/notification_backend/terminal_notifier_backend.rb', line 9

def notify(notification)
  opts = {
    title: 'twterm',
    subtitle: notification.title,
    group: Process.pid,
    sound: 'Purr',
  }

  opts[:open] = notification.url unless notification.url.nil?

  TerminalNotifier.notify(notification.body, opts)
end