Method: LinuxStat::Battery.discharging?

Defined in:
lib/linux_stat/battery.rb

.discharging?Boolean

Returns true if the battery is discharging, false if the battery is not discharging.

If the battery is not present or the information is not available, it will return nil.

Returns:

  • (Boolean)


89
90
91
92
# File 'lib/linux_stat/battery.rb', line 89

def discharging?
	return nil if status.empty?
	status.downcase == 'discharging'.freeze
end