Class: PopupNotifier

Inherits:
Object
  • Object
show all
Defined in:
lib/popup_notifier.rb

Overview

Generalizes the API for growl and snarl it should be easy to add support for more later.

Instance Method Summary collapse

Constructor Details

#initialize(*params) ⇒ PopupNotifier

Returns a new instance of PopupNotifier.



4
5
6
7
8
9
10
11
12
# File 'lib/popup_notifier.rb', line 4

def initialize(*params)
  if Notification.available_notifiers.include?("growl_notifier")
    @notifier = GrowlNotifier.new(*params)
  elsif Notification.available_notifiers.include?("snarl_notifier")
    @notifier = SnarlNotifier.new(*params)
  else
    raise LoadError("No popup notification system installed\n Try 'sudo gem install ruby-growl' or 'gem install snarl-growl'")
  end
end

Instance Method Details

#notify(*params) ⇒ Object



14
15
16
# File 'lib/popup_notifier.rb', line 14

def notify(*params)
  @notifier.notify(*params)
end