Class: SetVibrateAction
- Inherits:
-
VolumeAction
- Object
- MacroObject
- Action
- VolumeAction
- SetVibrateAction
- Defined in:
- lib/ruby-macrodroid/actions.rb
Overview
Category: Volume
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ SetVibrateAction
constructor
A new instance of SetVibrateAction.
- #to_s(colour: false, indent: 0) ⇒ Object
- #to_summary(colour: false) ⇒ Object
Methods inherited from Action
Methods included from ObjectX
#action_to_object, #object_create, #varify
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ SetVibrateAction
Returns a new instance of SetVibrateAction.
2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 |
# File 'lib/ruby-macrodroid/actions.rb', line 2703 def initialize(h={}) = { option: 'Silent (Vibrate On)', option_int: -1 } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object
2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 |
# File 'lib/ruby-macrodroid/actions.rb', line 2714 def to_s(colour: false, indent: 0) a = [ 'Silent (Vibrate On)', 'Normal (Vibrate Off)', 'Vibrate when ringing On', 'Vibrate when ringing Off', 'Vibrate when ringing Toggle' ] status = a[@h[:option_int]] @s = 'Vibrate Enable/Disable ' + "\n" + status super() end |
#to_summary(colour: false) ⇒ Object
2730 2731 2732 2733 2734 |
# File 'lib/ruby-macrodroid/actions.rb', line 2730 def to_summary(colour: false) @s = 'Vibrate Enable/Disable' end |