Class: Y2Network::AutoinstProfile::UdevRulesSection
- Inherits:
-
SectionWithAttributes
- Object
- SectionWithAttributes
- Y2Network::AutoinstProfile::UdevRulesSection
- Includes:
- Yast::Logger
- Defined in:
- src/lib/y2network/autoinst_profile/udev_rules_section.rb
Overview
This class represents an AutoYaST <net-udev> section under <networking>
Instance Attribute Summary collapse
Attributes inherited from SectionWithAttributes
Class Method Summary collapse
- .attributes ⇒ Object
-
.new_from_network(interfaces) ⇒ UdevRulesSection
Clones network interfaces settings into an AutoYaST interfaces section.
Instance Method Summary collapse
-
#init_from_hashes(hash) ⇒ Object
Method used by SectionWithAttributes.new_from_hashes to populate the attributes when importing a profile.
-
#init_from_network(interfaces) ⇒ Object
Method used by UdevRulesSection.new_from_network to populate the attributes when cloning udev rules settings.
-
#initialize(*_args) ⇒ UdevRulesSection
constructor
Constructor.
Methods inherited from SectionWithAttributes
new_from_hashes, #section_name, #to_hashes
Constructor Details
#initialize(*_args) ⇒ UdevRulesSection
Constructor
60 61 62 63 |
# File 'src/lib/y2network/autoinst_profile/udev_rules_section.rb', line 60 def initialize(*_args) super @udev_rules = [] end |
Instance Attribute Details
#udev_rules ⇒ Array<UdevRuleSection>
|
# File 'src/lib/y2network/autoinst_profile/udev_rules_section.rb', line 48
|
Class Method Details
.attributes ⇒ Object
40 41 42 43 44 |
# File 'src/lib/y2network/autoinst_profile/udev_rules_section.rb', line 40 def self.attributes [ { name: :udev_rules, xml_name: :"net-udev" } ] end |
.new_from_network(interfaces) ⇒ UdevRulesSection
Clones network interfaces settings into an AutoYaST interfaces section
55 56 57 |
# File 'src/lib/y2network/autoinst_profile/udev_rules_section.rb', line 55 def self.new_from_network(interfaces) new.tap { |r| r.init_from_network(interfaces) } end |
Instance Method Details
#init_from_hashes(hash) ⇒ Object
Method used by SectionWithAttributes.new_from_hashes to populate the attributes when importing a profile
68 69 70 |
# File 'src/lib/y2network/autoinst_profile/udev_rules_section.rb', line 68 def init_from_hashes(hash) @udev_rules = udev_rules_from_hash(hash) end |
#init_from_network(interfaces) ⇒ Object
Method used by new_from_network to populate the attributes when cloning udev rules settings
75 76 77 |
# File 'src/lib/y2network/autoinst_profile/udev_rules_section.rb', line 75 def init_from_network(interfaces) @udev_rules = udev_rules_section(interfaces) end |