Class: Y2Network::PhysicalInterface
- Defined in:
- src/lib/y2network/physical_interface.rb
Overview
Physical interface class (ethernet, wireless, infiniband...)
Instance Attribute Summary collapse
-
#custom_driver ⇒ String
User selected driver.
- #ethtool_options ⇒ String
Attributes inherited from Interface
#firmware_configured_by, #hardware, #name, #old_name, #renaming_mechanism, #type, #udev_rule
Instance Method Summary collapse
-
#current_driver ⇒ String
Returns the name of the current driver.
-
#initialize(name, type: InterfaceType::ETHERNET, hardware: nil) ⇒ PhysicalInterface
constructor
Constructor.
-
#modalias ⇒ String?
Returns interface modalias.
-
#present? ⇒ Boolean
Determines whether the interface is present (attached).
Methods inherited from Interface
#==, #config, #connected?, #drivers, #firmware_configured?, from_connection, #hash, #hotplug?, #rename, #update_udev_rule
Constructor Details
#initialize(name, type: InterfaceType::ETHERNET, hardware: nil) ⇒ PhysicalInterface
Constructor
41 42 43 44 45 46 |
# File 'src/lib/y2network/physical_interface.rb', line 41 def initialize(name, type: InterfaceType::ETHERNET, hardware: nil) super(name, type: type) # @hardware and @name should not change during life of the object @hardware = hardware || Hwinfo.for(name) || Hwinfo.new @description = @hardware.name end |
Instance Attribute Details
#custom_driver ⇒ String
User selected driver
This driver will be set using a udev rule.
34 35 36 |
# File 'src/lib/y2network/physical_interface.rb', line 34 def custom_driver @custom_driver end |
#ethtool_options ⇒ String
27 28 29 |
# File 'src/lib/y2network/physical_interface.rb', line 27 def @ethtool_options end |
Instance Method Details
#current_driver ⇒ String
Returns the name of the current driver
58 59 60 |
# File 'src/lib/y2network/physical_interface.rb', line 58 def current_driver @hardware.module end |
#modalias ⇒ String?
Returns interface modalias
51 52 53 |
# File 'src/lib/y2network/physical_interface.rb', line 51 def modalias @hardware.modalias end |
#present? ⇒ Boolean
Determines whether the interface is present (attached)
It relies in the hardware information
68 69 70 |
# File 'src/lib/y2network/physical_interface.rb', line 68 def present? @hardware.present? end |