Class: Junction::ScreenManager
- Inherits:
-
Object
- Object
- Junction::ScreenManager
- Includes:
- Singleton
- Defined in:
- lib/junction/screen_manager.rb
Instance Method Summary collapse
-
#initialize ⇒ ScreenManager
constructor
A new instance of ScreenManager.
- #start ⇒ Object
Constructor Details
#initialize ⇒ ScreenManager
Returns a new instance of ScreenManager.
8 9 10 11 |
# File 'lib/junction/screen_manager.rb', line 8 def initialize = Junction::Screens::MenuScreen.new @running = true end |
Instance Method Details
#start ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/junction/screen_manager.rb', line 13 def start # Trap Ctrl+C (SIGINT) to exit gracefully trap("SIGINT") do puts "\nExiting gracefully... Goodbye!" @running = false end while @running begin .render rescue Interrupt # Handle any mid-operation interruption if necessary puts "\nInterrupted! Returning to the menu." end end end |