Class: Installation::Console::MenuPlugin

Inherits:
Object
  • Object
show all
Extended by:
Yast::Logger
Defined in:
src/lib/installation/console/menu_plugin.rb

Overview

base class for the configuration menu plugins

Direct Known Subclasses

Plugins::ConsoleButtonPlugin

Class Method Summary collapse

Instance Method Summary collapse

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

.pluginsObject

the collected plugin objects



31
32
33
# File 'src/lib/installation/console/menu_plugin.rb', line 31

def self.plugins
  @plugins ||= []
end

.widgetsObject

get widgets for all plugins



36
37
38
39
# File 'src/lib/installation/console/menu_plugin.rb', line 36

def self.widgets
  plugins.sort_by! { |p| [p.order, p.class.to_s] }
  plugins.map(&:widget).compact
end

Instance Method Details

#orderInteger

define the display order (in ascending order), if the order value is same than it sorts by the class name

Returns:

  • (Integer)

    the order



50
51
52
# File 'src/lib/installation/console/menu_plugin.rb', line 50

def order
  100
end

#widgetCWM::Widget

return a widget do display

Returns:

  • (CWM::Widget)

    the widget



43
44
45
# File 'src/lib/installation/console/menu_plugin.rb', line 43

def widget
  nil
end