Class: DeviceLockedConstraint
- Inherits:
-
Constraint
- Object
- MacroObject
- Constraint
- DeviceLockedConstraint
- Defined in:
- lib/ruby-macrodroid/constraints.rb
Overview
Category: Device State
Instance Attribute Summary
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ DeviceLockedConstraint
constructor
A new instance of DeviceLockedConstraint.
- #to_s(colour: false, indent: 0) ⇒ Object (also: #to_summary)
Methods inherited from Constraint
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ DeviceLockedConstraint
Returns a new instance of DeviceLockedConstraint.
645 646 647 648 649 650 651 652 653 |
# File 'lib/ruby-macrodroid/constraints.rb', line 645 def initialize(h={}) = { locked: true } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary
655 656 657 |
# File 'lib/ruby-macrodroid/constraints.rb', line 655 def to_s(colour: false, indent: 0) 'Device ' + (@h[:locked] ? 'Locked' : 'Unlocked') end |