Class: SensorState
- Inherits:
-
Object
- Object
- SensorState
- Defined in:
- lib/lights/sensor.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#last_updated ⇒ Object
readonly
Returns the value of attribute last_updated.
Instance Method Summary collapse
-
#initialize(data) ⇒ SensorState
constructor
A new instance of SensorState.
Constructor Details
#initialize(data) ⇒ SensorState
Returns a new instance of SensorState.
3 4 5 6 |
# File 'lib/lights/sensor.rb', line 3 def initialize(data) @data = data @last_updated = data["lastupdated"] end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
2 3 4 |
# File 'lib/lights/sensor.rb', line 2 def data @data end |
#last_updated ⇒ Object (readonly)
Returns the value of attribute last_updated.
2 3 4 |
# File 'lib/lights/sensor.rb', line 2 def last_updated @last_updated end |