Class: TapState
- Inherits:
-
SensorState
- Object
- SensorState
- TapState
- Defined in:
- lib/lights/sensor.rb
Instance Attribute Summary collapse
-
#button_event ⇒ Object
readonly
Returns the value of attribute button_event.
Attributes inherited from SensorState
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(data) ⇒ TapState
constructor
A new instance of TapState.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(data) ⇒ TapState
Returns a new instance of TapState.
21 22 23 24 |
# File 'lib/lights/sensor.rb', line 21 def initialize(data) @button_event = data["button_event"] super end |
Instance Attribute Details
#button_event ⇒ Object (readonly)
Returns the value of attribute button_event.
20 21 22 |
# File 'lib/lights/sensor.rb', line 20 def @button_event end |
Instance Method Details
#data ⇒ Object
26 27 28 29 30 |
# File 'lib/lights/sensor.rb', line 26 def data data = @data data["button_event"] = @button_event if @button_event data end |
#to_json(options = {}) ⇒ Object
32 33 34 |
# File 'lib/lights/sensor.rb', line 32 def to_json(={}) data.to_json end |