Class: VolumeConstraint

Inherits:
Constraint show all
Defined in:
lib/ruby-macrodroid/constraints.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.



1172
1173
1174
1175
1176
1177
1178
1179
1180
# File 'lib/ruby-macrodroid/constraints.rb', line 1172

def initialize(h={})

  options = {
    option: 0
  }

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

end

Instance Method Details

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



1182
1183
1184
1185
1186
# File 'lib/ruby-macrodroid/constraints.rb', line 1182

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