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.
3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 |
# File 'lib/ruby-macrodroid/actions.rb', line 3007 def initialize(h={}) = { option: 'Silent (Vibrate On)', option_int: -1 } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object
3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 |
# File 'lib/ruby-macrodroid/actions.rb', line 3018 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
3034 3035 3036 3037 3038 |
# File 'lib/ruby-macrodroid/actions.rb', line 3034 def to_summary(colour: false) @s = 'Vibrate Enable/Disable' end |