Class: BatteryLevelTrigger
- Inherits:
-
Trigger
- Object
- MacroObject
- Trigger
- BatteryLevelTrigger
- Defined in:
- lib/ruby-macrodroid.rb
Overview
Category: Battery/Power
Instance Attribute Summary
Attributes inherited from Trigger
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ BatteryLevelTrigger
constructor
A new instance of BatteryLevelTrigger.
- #to_s ⇒ Object
Methods inherited from Trigger
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ BatteryLevelTrigger
Returns a new instance of BatteryLevelTrigger.
1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 |
# File 'lib/ruby-macrodroid.rb', line 1299 def initialize(h={}) = { battery_level: 50, decreases_to: true, option: 0 } super(.merge h) end |
Instance Method Details
#to_s ⇒ Object
1311 1312 1313 1314 |
# File 'lib/ruby-macrodroid.rb', line 1311 def to_s() operator = @h[:decreases_to] ? '<=' : '>=' "Battery %s %s%%" % [operator, @h[:battery_level]] end |