Class: Async::Container::Notify::Console
- Defined in:
- lib/async/container/notify/console.rb
Class Method Summary collapse
Instance Method Summary collapse
- #error!(text, **message) ⇒ Object
-
#initialize(logger) ⇒ Console
constructor
A new instance of Console.
- #ready!(**message) ⇒ Object
- #reloading!(**message) ⇒ Object
- #restarting!(**message) ⇒ Object
- #send(level: :debug, **message) ⇒ Object
Methods inherited from Client
Constructor Details
#initialize(logger) ⇒ Console
Returns a new instance of Console.
36 37 38 |
# File 'lib/async/container/notify/console.rb', line 36 def initialize(logger) @logger = logger end |
Class Method Details
.open!(logger = ::Console.logger) ⇒ Object
32 33 34 |
# File 'lib/async/container/notify/console.rb', line 32 def self.open!(logger = ::Console.logger) self.new(logger) end |
Instance Method Details
#error!(text, **message) ⇒ Object
64 65 66 |
# File 'lib/async/container/notify/console.rb', line 64 def error!(text, **) send(status: text, level: :error, **) end |
#ready!(**message) ⇒ Object
44 45 46 |
# File 'lib/async/container/notify/console.rb', line 44 def ready!(**) send(ready: true, **) end |
#reloading!(**message) ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/async/container/notify/console.rb', line 56 def reloading!(**) [:ready] = false [:reloading] = true [:status] ||= "Reloading..." send(**) end |
#restarting!(**message) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/async/container/notify/console.rb', line 48 def restarting!(**) [:ready] = false [:reloading] = true [:status] ||= "Restarting..." send(**) end |
#send(level: :debug, **message) ⇒ Object
40 41 42 |
# File 'lib/async/container/notify/console.rb', line 40 def send(level: :debug, **) @logger.send(level, self) {} end |