Class: BreakerMachines::Console
- Inherits:
-
Object
- Object
- BreakerMachines::Console
- Defined in:
- lib/breaker_machines/console.rb
Overview
Interactive console for debugging and monitoring circuit breakers
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Console
constructor
A new instance of Console.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Console
Returns a new instance of Console.
10 11 12 |
# File 'lib/breaker_machines/console.rb', line 10 def initialize @running = true end |
Class Method Details
.start ⇒ Object
6 7 8 |
# File 'lib/breaker_machines/console.rb', line 6 def self.start new.run end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/breaker_machines/console.rb', line 14 def run print_header print_help if BreakerMachines::Registry.instance.all_circuits.empty? while @running print_prompt command = gets&.chomp break unless command process_command(command) end puts "\nExiting BreakerMachines Console..." end |