Class: SetVibrateAction

Inherits:
VolumeAction show all
Defined in:
lib/ruby-macrodroid/actions.rb

Overview

Category: Volume

Instance Attribute Summary

Attributes inherited from Action

#constraints

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Action

#invoke

Methods included from ObjectX

#action_to_object, #object_create, #varify

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ SetVibrateAction

Returns a new instance of SetVibrateAction.



3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
# File 'lib/ruby-macrodroid/actions.rb', line 3041

def initialize(h={})

  options = {
    option: 'Silent (Vibrate On)',
    option_int: -1
  }

  super(options.merge h)

end

Instance Method Details

#to_s(colour: false, indent: 0) ⇒ Object



3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
# File 'lib/ruby-macrodroid/actions.rb', line 3052

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



3068
3069
3070
3071
3072
# File 'lib/ruby-macrodroid/actions.rb', line 3068

def to_summary(colour: false)
  
  @s = 'Vibrate Enable/Disable'
  
end