Class: RuGUI::BaseMainController
- Inherits:
-
BaseController
- Object
- BaseObject
- BaseController
- RuGUI::BaseMainController
- Defined in:
- lib/rugui/base_controller.rb
Overview
A base class for main controllers.
Provides a method for running the application as well as a method to quit.
Instance Attribute Summary
Attributes inherited from BaseController
#controllers, #main_models, #models, #parent_controller, #views
Instance Method Summary collapse
-
#framework_adapter ⇒ Object
Returns the framework_adapter for this class.
-
#quit ⇒ Object
Exits from the application.
-
#refresh ⇒ Object
Refreshes the GUI application, running just one event loop.
-
#run ⇒ Object
Runs the application.
Methods inherited from BaseController
controllers, #initialize, #main_controller, main_models, models, #post_registration, #register_controller, #register_main_model, #register_model, #register_view, views
Methods included from InitializeHooks
included, #initialize_with_hooks, update_initialize_method
Methods included from EntityRegistrationSupport
Methods included from SignalSupport
#autoconnect_declared_signals, included
Methods included from LogSupport
Methods included from PropertyObserver
included, #named_observable_property_updated, #property_updated
Methods included from FrameworkAdapters::FrameworkAdapterSupport
#framework_adapter_for, included, #load_framework_adapter
Methods inherited from BaseObject
Constructor Details
This class inherits a constructor from RuGUI::BaseController
Instance Method Details
#framework_adapter ⇒ Object
Returns the framework_adapter for this class.
222 223 224 |
# File 'lib/rugui/base_controller.rb', line 222 def framework_adapter framework_adapter_for('BaseMainController') end |
#quit ⇒ Object
Exits from the application.
247 248 249 250 251 |
# File 'lib/rugui/base_controller.rb', line 247 def quit logger.info "Exiting the application through #{self.class.name}." self.framework_adapter.quit logger.info "Application finished." end |
#refresh ⇒ Object
Refreshes the GUI application, running just one event loop.
This method is mostly useful when writing tests. It shouldn’t be used in normal applications.
240 241 242 |
# File 'lib/rugui/base_controller.rb', line 240 def refresh self.framework_adapter.refresh end |
#run ⇒ Object
Runs the application.
229 230 231 232 |
# File 'lib/rugui/base_controller.rb', line 229 def run logger.info "Starting the application through #{self.class.name}." self.framework_adapter.run end |