Class: ExternalPowerConstraint
- Inherits:
-
Constraint
- Object
- MacroObject
- Constraint
- ExternalPowerConstraint
- Defined in:
- lib/ruby-macrodroid/constraints.rb
Overview
Category: Battery/Power
Instance Attribute Summary
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ ExternalPowerConstraint
constructor
A new instance of ExternalPowerConstraint.
- #to_s(colour: false, indent: 0) ⇒ Object
Methods inherited from Constraint
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ ExternalPowerConstraint
Returns a new instance of ExternalPowerConstraint.
176 177 178 179 180 181 182 183 184 185 |
# File 'lib/ruby-macrodroid/constraints.rb', line 176 def initialize(h={}) = { external_power: true, power_connected_options: [false, true, false] } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object
187 188 189 190 |
# File 'lib/ruby-macrodroid/constraints.rb', line 187 def to_s(colour: false, indent: 0) connection = @h[:external_power] ? 'Connected' : 'Disconnected' 'Power ' + connection end |