Class: Y2Network::Presenters::S390GroupDeviceSummary

Inherits:
Object
  • Object
show all
Includes:
InterfaceStatus, Yast::I18n
Defined in:
src/lib/y2network/presenters/s390_group_device_summary.rb

Overview

This class converts a connection config configuration object into a string to be used in an AutoYaST summary or in a table.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from InterfaceStatus

#status_info

Constructor Details

#initialize(name, config) ⇒ S390GroupDeviceSummary

Constructor

Parameters:



40
41
42
43
44
# File 'src/lib/y2network/presenters/s390_group_device_summary.rb', line 40

def initialize(name, config)
  textdomain "network"
  @name = name
  @config = config
end

Instance Attribute Details

#nameString (readonly)

Returns:

  • (String)


34
35
36
# File 'src/lib/y2network/presenters/s390_group_device_summary.rb', line 34

def name
  @name
end

Instance Method Details

#textObject



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'src/lib/y2network/presenters/s390_group_device_summary.rb', line 46

def text
  device = @config.s390_devices.by_id(@name)
  hardware = device.hardware
  descr = hardware ? hardware.description : ""

  rich = Yast::HTML.Bold(descr) + "<br>"
  rich << "<b>ID: </b>" << device.id << "<br>"
  rich << "<b>Type: </b>" << device.type.short_name << "<br><br>"

  rich << "<p>"
  rich << _("The device is not enable. Press <b>Edit</b>\nto enable it.\n")
  rich << "</p>"

  rich
end