Class: Lshw::NetworkInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/lshw/network_interface.rb

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ NetworkInterface

Returns a new instance of NetworkInterface.



3
4
5
# File 'lib/lshw/network_interface.rb', line 3

def initialize(node)
  @node = node
end

Instance Method Details

#descriptionObject



7
8
9
# File 'lib/lshw/network_interface.rb', line 7

def description
  @node.search('./description').text
end

#macObject



11
12
13
# File 'lib/lshw/network_interface.rb', line 11

def mac
  @node.search('./serial').text
end

#productObject



15
16
17
# File 'lib/lshw/network_interface.rb', line 15

def product
  @node.search('./product').text
end

#speedObject



19
20
21
# File 'lib/lshw/network_interface.rb', line 19

def speed
  @node.search("./size[@units='bit/s']|./capacity").text.to_i
end