class Notifies::NotificationCenter

Constants

METHODS

Public Class Methods

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

Private Class Methods

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