class Notifies::Growl

Constants

METHODS

Public Class Methods

available?() click to toggle source
# File lib/notifies/growl.rb, line 8
def self.available?
  !!::Growl.installed?
end
notify(msg, options = {}) click to toggle source
# File lib/notifies/growl.rb, line 12
def self.notify msg, options = {}
  method = METHODS[options.delete(:type)] || :notify_info
  ::Growl.send method, msg, growl_options(options)
end

Private Class Methods

growl_options(options = {}) click to toggle source
# File lib/notifies/growl.rb, line 26
def self.growl_options options = {}
  Hash.new.tap do |h|
    h[:name] = options[:title] if options[:title]
    h[:title] = options[:subtitle] if options[:subtitle]
    h[:icon] = options[:icon] if options[:icon]
  end
end