Class: GrowlNotifier

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ GrowlNotifier

Returns a new instance of GrowlNotifier.



4
5
6
7
# File 'lib/growl_notifier.rb', line 4

def initialize(options = {})
  @application = options[:application] || 'ruby-growl'
  @to = options[:to]
end

Instance Method Details

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



9
10
11
12
13
14
15
# File 'lib/growl_notifier.rb', line 9

def notify(message, options = {})
  to = options[:to] || @to || 'localhost'
  notification_type = "#{@application} notification"
  
  g = Growl.new to, @application, [notification_type]
  g.notify notification_type, @application, message
end