Class: FaceUpDownConstraint
- Inherits:
-
Constraint
- Object
- MacroObject
- Constraint
- FaceUpDownConstraint
- Defined in:
- lib/ruby-macrodroid/constraints.rb
Overview
Category: Sensors
Instance Attribute Summary
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ FaceUpDownConstraint
constructor
A new instance of FaceUpDownConstraint.
- #to_s(colour: false, indent: 0) ⇒ Object (also: #to_summary)
Methods inherited from Constraint
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ FaceUpDownConstraint
Returns a new instance of FaceUpDownConstraint.
1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 |
# File 'lib/ruby-macrodroid/constraints.rb', line 1282 def initialize(h={}) = { option: -1, selected_options: [true, false, true, false, false, false] } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary
1293 1294 1295 1296 1297 1298 1299 |
# File 'lib/ruby-macrodroid/constraints.rb', line 1293 def to_s(colour: false, indent: 0) a = ['Face Up', 'Face Down', 'Vertical Upright', 'Vertical Upside Down', 'Sideways Left', 'Sideways Right'] s = @h[:selected_options].zip(a).select(&:first).map(&:last).join(', ') 'Device Facing' + "\n " + s #+ @h.inspect end |