class AmdgpuFan::StatSet

A set of stats

Attributes

avg[RW]
max[RW]
min[RW]
now[RW]
unit[R]

Public Class Methods

new(unit) click to toggle source
# File lib/amdgpu_fan/stat_set.rb, line 9
def initialize(unit)
  @unit = unit
end

Public Instance Methods

stats() click to toggle source
# File lib/amdgpu_fan/stat_set.rb, line 13
def stats
  { min: min, avg: avg, max: max, now: now }
end
to_s() click to toggle source

Return a string containing all the stats with units.

# File lib/amdgpu_fan/stat_set.rb, line 20
def to_s
  stats.map { |k, v| "#{k}: #{v.to_s.rjust(6)} #{unit.ljust(3)} " }.join
end