Class: Notifaction::Type::OSX
Constant Summary
Constants inherited from Base
Base::OK, Base::QUIT, Base::QUIT_SOFT
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#fire_hooks, #initialize, #ok, #quit, #quit_ok, #quit_soft
Constructor Details
This class inherits a constructor from Notifaction::Type::Base
Instance Method Details
#bubble(message, title) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/notifaction/types/osx.rb', line 6 def bubble(, title) @response = `osascript -e 'display notification "#{}" with title "#{title}"'` $?.exitstatus == 0 if fire_hooks(method: __method__, message: , title: title) quit_ok else quit_soft end end |
#modal(message, title, icon = :caution) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/notifaction/types/osx.rb', line 19 def modal(, title, icon = :caution) @response = `osascript -e 'tell app "System Events" to display dialog "#{}" buttons {"OK"} default button 1 with title "#{title}" with icon #{icon}'` $?.exitstatus == 0 if fire_hooks(method: __method__, message: , title: title) quit_ok else quit_soft end end |