Class: ProximitySensorConstraint

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

Overview

Category: Sensors

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 = {}) ⇒ ProximitySensorConstraint

Returns a new instance of ProximitySensorConstraint.



5906
5907
5908
5909
5910
5911
5912
5913
5914
# File 'lib/ruby-macrodroid.rb', line 5906

def initialize(h={})

  options = {
    near: true
  }

  super(options.merge h)

end

Instance Method Details

#to_s(colour: false) ⇒ Object



5916
5917
5918
# File 'lib/ruby-macrodroid.rb', line 5916

def to_s(colour: false)
  'Proximity Sensor: ' + (@h[:near] ? 'Near' : 'Far')
end