Class: Y2Network::HardwareWrapper

Inherits:
Object
  • Object
show all
Defined in:
src/lib/y2network/hwinfo.rb

Overview

A helper for Hwinfo.

Instance Method Summary collapse

Constructor Details

#initializeHardwareWrapper

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

#netcardsArray<Hwinfo>

Returns the network devices hardware information

Returns:

  • (Array<Hwinfo>)

    Hardware information for netword devices



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