Class: SnarlNotifier

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ SnarlNotifier

valid options:

application: the name of your application


6
7
8
# File 'lib/snarl_notifier.rb', line 6

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

Instance Method Details

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



11
12
13
14
# File 'lib/snarl_notifier.rb', line 11

def notify(message, options = {})
  title = options[:title] || "#{@application} notification"
  Snarl.show_message(title,message,options[:icon] || nil, options[:timeout] || Snarl::DEFAULT_TIMEOUT)
end