Method: ComputeUnit::Device#read_hwmon_data

Defined in:
lib/compute_unit/device.rb

#read_hwmon_data(item, default = nil) ⇒ String

Returns - the value of the item looked up.

Parameters:

  • item (String)
    • the name of the hwmon file to read from

  • default (Object) (defaults to: nil)
    • the default value to return if the file is empty or not readable

Returns:

  • (String)
    • the value of the item looked up



143
144
145
146
# File 'lib/compute_unit/device.rb', line 143

def read_hwmon_data(item, default = nil)
  path = File.join(hwmon_path, item)
  read_file(path, default)
end