Class: SetVibrateAction

Inherits:
VolumeAction show all
Defined in:
lib/ruby-macrodroid.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 inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ SetVibrateAction

Returns a new instance of SetVibrateAction.



4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
# File 'lib/ruby-macrodroid.rb', line 4639

def initialize(h={})

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

  super(options.merge h)

end

Instance Method Details

#to_s(colour: false) ⇒ Object



4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
# File 'lib/ruby-macrodroid.rb', line 4650

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



4666
4667
4668
4669
4670
# File 'lib/ruby-macrodroid.rb', line 4666

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