Class: Installation::Console::MenuPlugin
- Inherits:
-
Object
- Object
- Installation::Console::MenuPlugin
- Extended by:
- Yast::Logger
- Defined in:
- src/lib/installation/console/menu_plugin.rb
Overview
base class for the configuration menu plugins
Direct Known Subclasses
Class Method Summary collapse
-
.inherited(subclass) ⇒ Object
when a new subclass is defined this code gets executed.
-
.plugins ⇒ Object
the collected plugin objects.
-
.widgets ⇒ Object
get widgets for all plugins.
Instance Method Summary collapse
-
#order ⇒ Integer
define the display order (in ascending order), if the order value is same than it sorts by the class name.
-
#widget ⇒ CWM::Widget
return a widget do display.
Class Method Details
.inherited(subclass) ⇒ Object
when a new subclass is defined this code gets executed
23 24 25 26 27 28 |
# File 'src/lib/installation/console/menu_plugin.rb', line 23 def self.inherited(subclass) super # collect instances of all subclasses log.info("Found new plugin class: #{subclass}") plugins << subclass.new end |
.plugins ⇒ Object
the collected plugin objects
31 32 33 |
# File 'src/lib/installation/console/menu_plugin.rb', line 31 def self.plugins @plugins ||= [] end |
.widgets ⇒ Object
get widgets for all plugins
36 37 38 39 |
# File 'src/lib/installation/console/menu_plugin.rb', line 36 def self. plugins.sort_by! { |p| [p.order, p.class.to_s] } plugins.map(&:widget).compact end |
Instance Method Details
#order ⇒ Integer
define the display order (in ascending order), if the order value is same than it sorts by the class name
50 51 52 |
# File 'src/lib/installation/console/menu_plugin.rb', line 50 def order 100 end |
#widget ⇒ CWM::Widget
return a widget do display
43 44 45 |
# File 'src/lib/installation/console/menu_plugin.rb', line 43 def nil end |