Method: LinuxStat::Battery.charging?
- Defined in:
- lib/linux_stat/battery.rb
.charging? ⇒ Boolean
Returns true if the battery is charging, false if the battery is not charging.
If the battery is not present or the information is not available, it will return nil.
80 81 82 83 |
# File 'lib/linux_stat/battery.rb', line 80 def charging? return nil if status.empty? %w(full charging unknown).each(&:freeze).include?(status.downcase) end |