Class: Async::Container::Notify::Console
- Defined in:
- lib/async/container/notify/console.rb
Overview
Implements a general process readiness protocol with output to the local console.
Class Method Summary collapse
-
.open!(logger = ::Console.logger) ⇒ Object
Open a notification client attached to the current console.
Instance Method Summary collapse
-
#error!(text, **message) ⇒ Object
Send an error message to the console.
-
#initialize(logger) ⇒ Console
constructor
Initialize the notification client.
-
#send(level: :debug, **message) ⇒ Object
Send a message to the console.
Methods inherited from Client
#ready!, #reloading!, #restarting!, #status!, #stopping!
Constructor Details
#initialize(logger) ⇒ Console
Initialize the notification client.
39 40 41 |
# File 'lib/async/container/notify/console.rb', line 39 def initialize(logger) @logger = logger end |
Class Method Details
.open!(logger = ::Console.logger) ⇒ Object
Open a notification client attached to the current console.
33 34 35 |
# File 'lib/async/container/notify/console.rb', line 33 def self.open!(logger = ::Console.logger) self.new(logger) end |
Instance Method Details
#error!(text, **message) ⇒ Object
Send an error message to the console.
51 52 53 |
# File 'lib/async/container/notify/console.rb', line 51 def error!(text, **) send(status: text, level: :error, **) end |
#send(level: :debug, **message) ⇒ Object
Send a message to the console.
44 45 46 |
# File 'lib/async/container/notify/console.rb', line 44 def send(level: :debug, **) @logger.send(level, self) {} end |