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) ⇒ Object
- #to_summary(colour: false) ⇒ Object
Methods inherited from Action
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ SetVibrateAction
Returns a new instance of SetVibrateAction.
1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 |
# File 'lib/ruby-macrodroid/actions.rb', line 1957 def initialize(h={}) = { option: 'Silent (Vibrate On)', option_int: -1 } super(.merge h) end |
Instance Method Details
#to_s(colour: false) ⇒ Object
1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 |
# File 'lib/ruby-macrodroid/actions.rb', line 1968 def to_s(colour: false) 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 + "\n " super() end |
#to_summary(colour: false) ⇒ Object
1984 1985 1986 1987 1988 |
# File 'lib/ruby-macrodroid/actions.rb', line 1984 def to_summary(colour: false) @s = 'Vibrate Enable/Disable' end |