Class: SharedTools::Tools::Notification::BaseDriver
- Inherits:
-
Object
- Object
- SharedTools::Tools::Notification::BaseDriver
- Defined in:
- lib/shared_tools/tools/notification/base_driver.rb
Overview
Abstract base class for platform-specific notification drivers. Subclasses must implement notify, alert, and speak.
Direct Known Subclasses
Instance Method Summary collapse
-
#alert(message:, title: nil, buttons: ['OK'], default_button: nil) ⇒ Hash
Show a modal dialog and wait for the user to click a button.
-
#notify(message:, title: nil, subtitle: nil, sound: nil) ⇒ Hash
Show a non-blocking desktop banner notification.
-
#speak(text:, voice: nil, rate: nil) ⇒ Hash
Speak text aloud using text-to-speech.
Instance Method Details
#alert(message:, title: nil, buttons: ['OK'], default_button: nil) ⇒ Hash
Show a modal dialog and wait for the user to click a button.
27 28 29 |
# File 'lib/shared_tools/tools/notification/base_driver.rb', line 27 def alert(message:, title: nil, buttons: ['OK'], default_button: nil) raise NotImplementedError, "#{self.class}##{__method__} undefined" end |
#notify(message:, title: nil, subtitle: nil, sound: nil) ⇒ Hash
Show a non-blocking desktop banner notification.
16 17 18 |
# File 'lib/shared_tools/tools/notification/base_driver.rb', line 16 def notify(message:, title: nil, subtitle: nil, sound: nil) raise NotImplementedError, "#{self.class}##{__method__} undefined" end |
#speak(text:, voice: nil, rate: nil) ⇒ Hash
Speak text aloud using text-to-speech.
37 38 39 |
# File 'lib/shared_tools/tools/notification/base_driver.rb', line 37 def speak(text:, voice: nil, rate: nil) raise NotImplementedError, "#{self.class}##{__method__} undefined" end |