Class: CameraFlashLightAction
- Inherits:
-
DeviceSettingsAction
- Object
- MacroObject
- Action
- DeviceSettingsAction
- CameraFlashLightAction
- Defined in:
- lib/ruby-macrodroid.rb
Overview
Category: Device Settings
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ CameraFlashLightAction
constructor
A new instance of CameraFlashLightAction.
- #to_pc ⇒ Object
- #to_s(colour: false) ⇒ Object
Methods inherited from Action
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ CameraFlashLightAction
Returns a new instance of CameraFlashLightAction.
3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 |
# File 'lib/ruby-macrodroid.rb', line 3508 def initialize(h={}) = { launch_foreground: false, state: 0 } super(.merge h) end |
Instance Method Details
#to_pc ⇒ Object
3519 3520 3521 |
# File 'lib/ruby-macrodroid.rb', line 3519 def to_pc() ['torch :on', 'torch :off', 'torch :toggle'][@h[:state]] end |
#to_s(colour: false) ⇒ Object
3523 3524 3525 |
# File 'lib/ruby-macrodroid.rb', line 3523 def to_s(colour: false) ['Torch On', 'Torch Off', 'Torch Toggle'][@h[:state]] end |