Class: Y2Network::HardwareWrapper
- Inherits:
-
Object
- Object
- Y2Network::HardwareWrapper
- Defined in:
- src/lib/y2network/hwinfo.rb
Overview
A helper for Hwinfo.
Instance Method Summary collapse
-
#initialize ⇒ HardwareWrapper
constructor
A new instance of HardwareWrapper.
-
#netcards ⇒ Array<Hwinfo>
Returns the network devices hardware information.
Constructor Details
#initialize ⇒ HardwareWrapper
Returns a new instance of HardwareWrapper.
28 29 30 |
# File 'src/lib/y2network/hwinfo.rb', line 28 def initialize Yast.include self, "network/routines.rb" end |
Instance Method Details
#netcards ⇒ Array<Hwinfo>
Returns the network devices hardware information
35 36 37 38 39 40 41 42 43 |
# File 'src/lib/y2network/hwinfo.rb', line 35 def netcards return @netcards if @netcards @netcards = ReadHardware("netcard").map do |attrs| name = attrs["dev_name"] extra_attrs = name.to_s.empty? ? {} : extra_attrs_for(name) Hwinfo.new(attrs.merge(extra_attrs)) end end |