Method: Jkr::Cpufreq::Config#to_s

Defined in:
lib/jkr/cpufreq.rb

#to_sObject



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/jkr/cpufreq.rb', line 79

def to_s
  cpuconfig = @cpuconfigs.first

  ret = cpuconfig.governor

  suffix = case cpuconfig.governor
           when /\Aperformance\Z/
             nil
           when /\Apowersave\Z/
             nil
           when /\Auserspace\Z/
             cpuconfig.params[:frequency] / 1000000.0
           when /\Aondemand\Z/
             nil
           end

  if suffix
    ret += ":freq=#{suffix}GHz"
  end

  ret
end