Method: LinuxStat::Battery.status
- Defined in:
- lib/linux_stat/battery.rb
.status ⇒ Object
Returns the status of the battery. The status generally includes either of the full, charging, discharging and unknown states in most cases.
If the battery is not present or the information is not available, it will return an empty frozen String.
70 71 72 73 74 |
# File 'lib/linux_stat/battery.rb', line 70 def status @@status_file ||= File.join(PATH, 'status'.freeze) return ''.freeze unless status_readable? IO.read(@@status_file).tap(&:strip!) end |