Class: Lshw::System
- Inherits:
-
Object
- Object
- Lshw::System
- Defined in:
- lib/lshw/system.rb
Constant Summary collapse
- CPU_PATH =
"//node[@class='processor']"
- DESCRIPTION_PATH =
'/list/node/description'
- DISKS_PATH =
"//node[@id='disk']"
- MEMORY_PATH =
"//node[@id='memory']"
- NETWORK_PATH =
"//node[@class='network' and @handle!='']"
- PRODUCT_PATH =
'/list/node/product'
Instance Method Summary collapse
- #cpus ⇒ Object
- #description ⇒ Object
- #disks ⇒ Object
-
#initialize(hw) ⇒ System
constructor
A new instance of System.
- #memory ⇒ Object
- #network_interfaces ⇒ Object
- #product ⇒ Object
Constructor Details
#initialize(hw) ⇒ System
Returns a new instance of System.
12 13 14 |
# File 'lib/lshw/system.rb', line 12 def initialize(hw) @hw = hw end |
Instance Method Details
#cpus ⇒ Object
16 17 18 |
# File 'lib/lshw/system.rb', line 16 def cpus @hw.search(CPU_PATH).collect { |cpu| ::Lshw::CPU.new cpu } end |
#description ⇒ Object
20 21 22 |
# File 'lib/lshw/system.rb', line 20 def description @hw.search(DESCRIPTION_PATH).text end |
#disks ⇒ Object
24 25 26 |
# File 'lib/lshw/system.rb', line 24 def disks @hw.search(DISKS_PATH).collect { |disk| ::Lshw::Disk.new disk } end |
#memory ⇒ Object
28 29 30 |
# File 'lib/lshw/system.rb', line 28 def memory ::Lshw::Memory.new @hw.search(MEMORY_PATH) end |
#network_interfaces ⇒ Object
32 33 34 |
# File 'lib/lshw/system.rb', line 32 def network_interfaces @hw.search(NETWORK_PATH).collect { |i| ::Lshw::NetworkInterface.new i } end |
#product ⇒ Object
36 37 38 |
# File 'lib/lshw/system.rb', line 36 def product @hw.search(PRODUCT_PATH).text end |