Class: Neurio::Reading
- Inherits:
-
Object
- Object
- Neurio::Reading
- Defined in:
- lib/neurio.rb
Instance Attribute Summary collapse
-
#consumption_energy ⇒ Object
readonly
Returns the value of attribute consumption_energy.
-
#consumption_power ⇒ Object
readonly
Returns the value of attribute consumption_power.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(values) ⇒ Reading
constructor
A new instance of Reading.
Constructor Details
#initialize(values) ⇒ Reading
Returns a new instance of Reading.
9 10 11 12 13 |
# File 'lib/neurio.rb', line 9 def initialize(values) = DateTime.parse(values["timestamp"]).to_time @consumption_power = values["consumptionPower"] @consumption_energy = values["consumptionEnergy"] end |
Instance Attribute Details
#consumption_energy ⇒ Object (readonly)
Returns the value of attribute consumption_energy.
8 9 10 |
# File 'lib/neurio.rb', line 8 def consumption_energy @consumption_energy end |
#consumption_power ⇒ Object (readonly)
Returns the value of attribute consumption_power.
8 9 10 |
# File 'lib/neurio.rb', line 8 def consumption_power @consumption_power end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
8 9 10 |
# File 'lib/neurio.rb', line 8 def end |