Module: Lspci

Defined in:
lib/lspci.rb,
lib/lspci/parser.rb,
lib/lspci/version.rb

Defined Under Namespace

Classes: Parser

Constant Summary collapse

VERSION =
"0.1.3"

Class Method Summary collapse

Class Method Details

.pci_devices(lspci_output = nil) ⇒ Object

Get an array of PCI Devices with details in a Hash

Example:

>> Lspci.pci_devices
=>
  [{"slot"=>"00:00.0",
  "class"=>"Host bridge",
  "vendor"=>"Intel Corporation",
  "device"=>"Intel Kaby Lake Host Bridge",
  "svendor"=>"ASUSTeK Computer Inc.",
  "sdevice"=>"Device 872f",
  "rev"=>"05"}]

Arguments:

lspci_output: (String) -- Optional
  You can pass in the output from `lspci -vmm` to be parsed


22
23
24
# File 'lib/lspci.rb', line 22

def pci_devices(lspci_output=nil)
  Lspci::Parser.parse(lspci_output)
end