Class: FlipDeviceTrigger
- Inherits:
-
SensorsTrigger
- Object
- MacroObject
- Trigger
- SensorsTrigger
- FlipDeviceTrigger
- Defined in:
- lib/ruby-macrodroid/triggers.rb
Overview
Category: Sensors
options:
Face Up -> Face Down
Face Down -> Face Up
Any -> Face Down
Instance Attribute Summary
Attributes inherited from Trigger
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ FlipDeviceTrigger
constructor
A new instance of FlipDeviceTrigger.
- #to_pc ⇒ Object
- #to_s(colour: false) ⇒ Object
Methods inherited from Trigger
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ FlipDeviceTrigger
Returns a new instance of FlipDeviceTrigger.
1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1421 def initialize(h={}) = { any_start: false, face_down: true, work_with_screen_off: false } super(.merge h) end |
Instance Method Details
#to_pc ⇒ Object
1433 1434 1435 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1433 def to_pc() @h[:face_down] ? 'flip_device_down?' : 'flip_device_up?' end |
#to_s(colour: false) ⇒ Object
1437 1438 1439 1440 1441 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1437 def to_s(colour: false) action = @h[:face_down] ? 'Face Up -> Face Down' : 'Face Down -> Face Up' 'Flip Device ' + action end |