Class: ProximityTrigger
- Inherits:
-
SensorsTrigger
- Object
- MacroObject
- Trigger
- SensorsTrigger
- ProximityTrigger
- Defined in:
- lib/ruby-macrodroid.rb
Overview
Category: Sensors
Instance Attribute Summary
Attributes inherited from Trigger
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ ProximityTrigger
constructor
A new instance of ProximityTrigger.
- #to_s ⇒ Object
Methods inherited from Trigger
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ ProximityTrigger
Returns a new instance of ProximityTrigger.
2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 |
# File 'lib/ruby-macrodroid.rb', line 2186 def initialize(h={}) if h[:distance] then case h[:distance].to_sym when :near [:near] = true end end = { near: true, selected_option: 0 } super(.merge filter(,h)) end |
Instance Method Details
#to_s ⇒ Object
2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 |
# File 'lib/ruby-macrodroid.rb', line 2205 def to_s() distance = if @h[:near] then 'Near' else 'Far' end "Proximity Sensor (%s)" % distance end |