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.



5741
5742
5743
5744
5745
5746
5747
5748
5749
# File 'lib/ruby-macrodroid.rb', line 5741

def initialize(h={})

  options = {
    option: 0
  }

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

end

Instance Method Details

#to_s(colour: false) ⇒ Object



5751
5752
5753
5754
5755
# File 'lib/ruby-macrodroid.rb', line 5751

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