Class: Lshw::NetworkInterface
- Inherits:
-
Object
- Object
- Lshw::NetworkInterface
- Defined in:
- lib/lshw/network_interface.rb
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(node) ⇒ NetworkInterface
constructor
A new instance of NetworkInterface.
- #mac ⇒ Object
- #product ⇒ Object
- #speed ⇒ Object
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
#description ⇒ Object
7 8 9 |
# File 'lib/lshw/network_interface.rb', line 7 def description @node.search('./description').text end |
#mac ⇒ Object
11 12 13 |
# File 'lib/lshw/network_interface.rb', line 11 def mac @node.search('./serial').text end |
#product ⇒ Object
15 16 17 |
# File 'lib/lshw/network_interface.rb', line 15 def product @node.search('./product').text end |
#speed ⇒ Object
19 20 21 |
# File 'lib/lshw/network_interface.rb', line 19 def speed @node.search("./size[@units='bit/s']|./capacity").text.to_i end |