Class: Boxafe::Notifier::NotificationCenter

Inherits:
Boxafe::Notifier show all
Defined in:
lib/boxafe/notifier/notification_center.rb

Constant Summary collapse

METHODS =
{
  info: :notify,
  success: :success,
  failure: :failed
}

Constants inherited from Boxafe::Notifier

IMPLEMENTATIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Boxafe::Notifier

#initialize, notifier, notifier_instance, platform_notifier

Constructor Details

This class inherits a constructor from Boxafe::Notifier

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/boxafe/notifier/notification_center.rb', line 11

def self.available?
  TerminalNotifier::Guard.available?
end

Instance Method Details

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



15
16
17
18
# File 'lib/boxafe/notifier/notification_center.rb', line 15

def notify msg, options = {}
  method = METHODS[options.delete(:type)] || :notify
  TerminalNotifier::Guard.send method, msg, terminal_notifier_options(options)
end