Class: TomatoPaste::Notification

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

Constant Summary collapse

NOTIFICATION_SOUND =
File.join(TomatoPaste.sounds, "brass-bell.mp3")

Class Method Summary collapse

Class Method Details

.audio_alert_commandObject



8
9
10
# File 'lib/tomato_paste/notification.rb', line 8

def self.audio_alert_command
  "afplay #{NOTIFICATION_SOUND}"
end

.display_visual_alert(message) ⇒ Object



16
17
18
19
# File 'lib/tomato_paste/notification.rb', line 16

def self.display_visual_alert(message)
  return false if message.nil? || message.empty?
  TerminalNotifier.notify(message, title: "Tomato Paste")
end

.play_audio_alertObject



12
13
14
# File 'lib/tomato_paste/notification.rb', line 12

def self.play_audio_alert
  system(self.audio_alert_command)
end