Method: LinuxStat::Battery.model
- Defined in:
- lib/linux_stat/battery.rb
.model ⇒ Object
Returns the model of the battery.
If the battery is not present or the information isn’t available it will return an empty String.
38 39 40 41 42 43 |
# File 'lib/linux_stat/battery.rb', line 38 def model @@mn_file = File.join(PATH, 'model_name') return ''.freeze unless File.readable?(@@mn_file) IO.read(@@mn_file).tap(&:strip!) end |