Class: Notify
- Inherits:
-
Object
- Object
- Notify
- Extended by:
- Notifaction::Helpers
- Defined in:
- lib/notifaction/notify.rb
Class Method Summary collapse
-
.bubble(message, title) ⇒ Object
Display a notification bubble.
-
.error(message, config = {}) ⇒ Object
Prints a pre-formatted error message to the console.
-
.info(message, config = {}) ⇒ Object
Prints a pre-formatted informational message to the console.
-
.modal(message, title) ⇒ Object
Display a modal popup with a close button.
-
.note(message, config = {}) ⇒ Object
Prints a pre-formatted secondary informational message to the console.
-
.spacer(config = {}) ⇒ Object
pretty-print a spacer.
-
.spit(message, config = {}) ⇒ Object
Prints a pre-formatted unstyled message to the console.
-
.success(message, config = {}) ⇒ Object
Prints a pre-formatted success message to the console.
-
.warning(message, config = {}) ⇒ Object
Prints a pre-formatted warning message to the console.
Methods included from Notifaction::Helpers
auto_quit_enabled?, deprecation_notice
Class Method Details
.bubble(message, title) ⇒ Object
Display a notification bubble
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/notifaction/notify.rb', line 6 def self.bubble(, title) if Notifaction::Utils.os == :macosx handler = Notifaction::Type::OSX.new else handler = Notifaction::Type::Linux.new end handler.bubble(, title) handler.quit_ok end |
.error(message, config = {}) ⇒ Object
Prints a pre-formatted error message to the console
32 33 34 35 36 |
# File 'lib/notifaction/notify.rb', line 32 def self.error(, config = {}) handler = Notifaction::Type::Terminal.new handler.error(, config) handler.quit unless auto_quit_enabled?(config, handler.user_conf) end |
.info(message, config = {}) ⇒ Object
Prints a pre-formatted informational message to the console
47 48 49 50 |
# File 'lib/notifaction/notify.rb', line 47 def self.info(, config = {}) handler = Notifaction::Type::Terminal.new handler.info(, config) end |
.modal(message, title) ⇒ Object
Display a modal popup with a close button
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/notifaction/notify.rb', line 19 def self.modal(, title) if Notifaction::Utils.os == :macosx handler = Notifaction::Type::OSX.new else handler = Notifaction::Type::Linux.new end handler.modal(, title) handler.quit_ok end |
.note(message, config = {}) ⇒ Object
Prints a pre-formatted secondary informational message to the console
54 55 56 57 |
# File 'lib/notifaction/notify.rb', line 54 def self.note(, config = {}) handler = Notifaction::Type::Terminal.new handler.note(, config) end |
.spacer(config = {}) ⇒ Object
pretty-print a spacer
75 76 77 78 |
# File 'lib/notifaction/notify.rb', line 75 def self.spacer(config = {}) handler = Notifaction::Type::Terminal.new handler.spacer(config) end |
.spit(message, config = {}) ⇒ Object
Prints a pre-formatted unstyled message to the console
68 69 70 71 |
# File 'lib/notifaction/notify.rb', line 68 def self.spit(, config = {}) handler = Notifaction::Type::Terminal.new handler.spit(, config) end |
.success(message, config = {}) ⇒ Object
Prints a pre-formatted success message to the console
61 62 63 64 |
# File 'lib/notifaction/notify.rb', line 61 def self.success(, config = {}) handler = Notifaction::Type::Terminal.new handler.success(, config) end |
.warning(message, config = {}) ⇒ Object
Prints a pre-formatted warning message to the console
40 41 42 43 |
# File 'lib/notifaction/notify.rb', line 40 def self.warning(, config = {}) handler = Notifaction::Type::Terminal.new handler.warning(, config) end |