Method: LinuxStat::BIOS.model

Defined in:
lib/linux_stat/bios.rb

.modelObject

Returns the model of the BIOS.

If the information is not available it will return a frozen empty string.

The output is also cached (memoized) ; as changing the value in runtime is unexpected.



12
13
14
15
16
17
18
19
20
21
# File 'lib/linux_stat/bios.rb', line 12

def model
	# cached (memoized) ; as changing the value in runtime is unexpected
	@@model ||= if File.readable?('/sys/devices/virtual/dmi/id/product_name')
		IO.read('/sys/devices/virtual/dmi/id/product_name').tap(&:strip!)
	elsif File.readable?('/sys/firmware/devicetree/base/model')
		IO.read('/sys/firmware/devicetree/base/model').tap(&:strip!)
	else
		''.freeze
	end
end