Class: Pomo::Notifier

Inherits:
Object
  • Object
show all
Defined in:
lib/pomo/notifier.rb,
lib/pomo/notifier/growl_notifier.rb,
lib/pomo/notifier/libnotify_notifier.rb,
lib/pomo/notifier/quicksilver_notifier.rb,
lib/pomo/notifier/notification_center_notifier.rb

Defined Under Namespace

Classes: GrowlNotifier, LibnotifyNotifier, NotificationCenterNotifier, QuicksilverNotifier

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Notifier

Initialize notifier library from configuration.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/pomo/notifier.rb', line 12

def initialize(config)
  if config.notifier == 'notification_center'
    @notifier = Pomo::Notifier::NotificationCenterNotifier.new
  elsif config.notifier == 'growl'
    @notifier = Pomo::Notifier::GrowlNotifier.new
  elsif config.notifier == 'libnotify'
    @notifier = Pomo::Notifier::LibnotifyNotifier.new
  elsif config.notifier == 'quicksilver'
    @notifier = Pomo::Notifier::QuicksilverNotifier.new
  end
end

Instance Method Details

#notify(message, opts = {}) ⇒ Object

Send message to notification library.



27
28
29
# File 'lib/pomo/notifier.rb', line 27

def notify(message, opts = {})
  @notifier.notify(message, opts)
end