Class: ExternalPowerConstraint
- Inherits:
-
Constraint
- Object
- MacroObject
- Constraint
- ExternalPowerConstraint
- Defined in:
- lib/ruby-macrodroid.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) ⇒ Object
Methods inherited from Constraint
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ ExternalPowerConstraint
Returns a new instance of ExternalPowerConstraint.
4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 |
# File 'lib/ruby-macrodroid.rb', line 4871 def initialize(h={}) = { external_power: true, power_connected_options: [false, true, false] } super(.merge h) end |
Instance Method Details
#to_s(colour: false) ⇒ Object
4882 4883 4884 4885 |
# File 'lib/ruby-macrodroid.rb', line 4882 def to_s(colour: false) connection = @h[:external_power] ? 'Connected' : 'Disconnected' 'Power ' + connection end |