Class: Y2Network::AutoinstProfile::S390DevicesSection

Inherits:
SectionWithAttributes show all
Includes:
Yast::Logger
Defined in:
src/lib/y2network/autoinst_profile/s390_devices_section.rb

Overview

This class represents an AutoYaST section under

0.0.0700 0.0.0701 0.0.0702 qeth

See Also:

Constant Summary collapse

SUPPORTED_TYPES =
["qeth", "ctc", "lcs"].freeze

Constants inherited from SectionWithAttributes

Y2Network::AutoinstProfile::SectionWithAttributes::VALUES_TO_SKIP

Instance Attribute Summary collapse

Attributes inherited from SectionWithAttributes

#parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SectionWithAttributes

#attribute_key, #attribute_name, #attribute_scalar, #attribute_skip?, #attribute_value, #attributes, define_attr_accessors, #init_scalars_from_hash, new_from_hashes, #section_name, #to_hashes

Constructor Details

#initialize(*_args) ⇒ S390DevicesSection

Constructor


63
64
65
66
# File 'src/lib/y2network/autoinst_profile/s390_devices_section.rb', line 63

def initialize(*_args)
  super
  @devices = []
end

Instance Attribute Details

#devicesArray<S390DeviceSection>


# File 'src/lib/y2network/autoinst_profile/s390_devices_section.rb', line 48


Class Method Details

.attributesObject


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

def self.attributes
  [
    { name: :devices }
  ]
end

.new_from_network(config) ⇒ S390DevicesSection

Clones network s390 devices settings into an AutoYaST s390-devices section


56
57
58
59
60
# File 'src/lib/y2network/autoinst_profile/s390_devices_section.rb', line 56

def self.new_from_network(config)
  result = new
  initialized = result.init_from_network(config)
  initialized ? result : nil
end

Instance Method Details

#init_from_hashes(hash) ⇒ Object

Method used by Y2Network::AutoinstProfile::SectionWithAttributes.new_from_hashes to populate the attributes when importing a profile


71
72
73
# File 'src/lib/y2network/autoinst_profile/s390_devices_section.rb', line 71

def init_from_hashes(hash)
  @devices = devices_from_hash(hash)
end

#init_from_network(connection_configs) ⇒ Boolean

Method used by new_from_network to populate the attributes when cloning routing settings


79
80
81
82
# File 'src/lib/y2network/autoinst_profile/s390_devices_section.rb', line 79

def init_from_network(connection_configs)
  @devices = s390_devices_section(connection_configs)
  true
end