Class: ProximitySensorConstraint

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

Overview

Category: Sensors

Instance Attribute Summary

Attributes inherited from MacroObject

#options, #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.



4913
4914
4915
4916
4917
4918
4919
4920
4921
# File 'lib/ruby-macrodroid.rb', line 4913

def initialize(h={})

  options = {
    near: true
  }

  super(options.merge h)

end

Instance Method Details

#to_sObject



4923
4924
4925
# File 'lib/ruby-macrodroid.rb', line 4923

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