Class: Y2Network::Presenters::InterfacesSummary
- Inherits:
-
Object
- Object
- Y2Network::Presenters::InterfacesSummary
- Includes:
- InterfaceStatus, Yast::I18n, Yast::Logger
- Defined in:
- src/lib/y2network/presenters/interfaces_summary.rb
Overview
This class converts a connection config configurations into a string to be used in an AutoYaST summary.
Instance Attribute Summary collapse
- #config ⇒ Config readonly
Instance Method Summary collapse
-
#initialize(config) ⇒ InterfacesSummary
constructor
A new instance of InterfacesSummary.
- #text ⇒ Object
Methods included from InterfaceStatus
Constructor Details
#initialize(config) ⇒ InterfacesSummary
38 39 40 |
# File 'src/lib/y2network/presenters/interfaces_summary.rb', line 38 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Config (readonly)
36 37 38 |
# File 'src/lib/y2network/presenters/interfaces_summary.rb', line 36 def config @config end |
Instance Method Details
#text ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'src/lib/y2network/presenters/interfaces_summary.rb', line 42 def text overview = config.interfaces.map do |interface| connection = config.connections.by_name(interface.name) descr = interface.hardware ? interface.hardware.description : "" descr = interface.name if descr.empty? status = connection ? status_info(connection) : Yast::Summary.NotConfigured Yast::Summary.Device(descr, status) end Yast::Summary.DevicesList(overview) end |