Class: ProximityTrigger
- Inherits:
-
SensorsTrigger
- Object
- MacroObject
- Trigger
- SensorsTrigger
- ProximityTrigger
- Defined in:
- lib/ruby-macrodroid.rb
Overview
Category: Sensors
Instance Attribute Summary
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.
2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 |
# File 'lib/ruby-macrodroid.rb', line 2116 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
2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 |
# File 'lib/ruby-macrodroid.rb', line 2135 def to_s() distance = if @h[:near] then 'Near' else 'Far' end "Proximity Sensor (%s)" % distance end |