Class: VolumeConstraint

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

Overview

Category: Screen and Speaker

Instance Attribute Summary

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Constraint

#match?

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ VolumeConstraint

Returns a new instance of VolumeConstraint.



5727
5728
5729
5730
5731
5732
5733
5734
5735
# File 'lib/ruby-macrodroid.rb', line 5727

def initialize(h={})

  options = {
    option: 0
  }

  super(options.merge filter(options, h))

end

Instance Method Details

#to_s(colour: false) ⇒ Object



5737
5738
5739
5740
5741
# File 'lib/ruby-macrodroid.rb', line 5737

def to_s(colour: false)
  a = ['Volume On', 'Vibrate Only' 'Silent', 'Vibrate or Silent']
  
  "Ringer Volume\n  " + a[@h[:option]]
end