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.



2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
# File 'lib/ruby-macrodroid/actions.rb', line 2936

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



2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
# File 'lib/ruby-macrodroid/actions.rb', line 2947

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



2963
2964
2965
2966
2967
# File 'lib/ruby-macrodroid/actions.rb', line 2963

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