Class: LightLevelConstraint
- Inherits:
-
Constraint
- Object
- MacroObject
- Constraint
- LightLevelConstraint
- Defined in:
- lib/ruby-macrodroid.rb
Overview
Category: Sensors
Instance Attribute Summary
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ LightLevelConstraint
constructor
A new instance of LightLevelConstraint.
- #to_s(colour: false) ⇒ Object
Methods inherited from Constraint
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ LightLevelConstraint
Returns a new instance of LightLevelConstraint.
5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 |
# File 'lib/ruby-macrodroid.rb', line 5859 def initialize(h={}) = { light_level: -1, light_level_float: 5000.0, option: 1 } super(.merge h) end |
Instance Method Details
#to_s(colour: false) ⇒ Object
5871 5872 5873 5874 5875 5876 5877 |
# File 'lib/ruby-macrodroid.rb', line 5871 def to_s(colour: false) operator = @h[:light_level] == -1 ? 'Less than' : 'Greater than' condition = operator + ' ' + @h[:light_level_float].to_s + 'lx' 'Light Sensor ' + condition end |