Class: Mixergy::Status
- Inherits:
-
Object
- Object
- Mixergy::Status
- Defined in:
- lib/mixergy/status.rb
Overview
Represents the latest status/measurement for a Mixergy tank.
Instance Attribute Summary collapse
-
#bottom_temperature ⇒ Float
readonly
Bottom temperature in Celsius.
-
#charge ⇒ Float
readonly
Current charge percentage.
-
#current ⇒ Float
readonly
Current in Amps.
-
#frequency ⇒ Float
readonly
Frequency in Hz.
-
#top_temperature ⇒ Float
readonly
Top temperature in Celsius.
-
#voltage ⇒ Float
readonly
Voltage in Volts.
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Status
constructor
Create a new Status object from API data.
Constructor Details
#initialize(data = {}) ⇒ Status
Create a new Status object from API data.
23 24 25 26 27 28 29 30 |
# File 'lib/mixergy/status.rb', line 23 def initialize(data = {}) @charge = data["charge"] @top_temperature = data["topTemperature"] @bottom_temperature = data["bottomTemperature"] @frequency = data["frequency"] @voltage = data["voltage"] @current = data["current"] end |
Instance Attribute Details
#bottom_temperature ⇒ Float (readonly)
Returns Bottom temperature in Celsius.
13 14 15 |
# File 'lib/mixergy/status.rb', line 13 def bottom_temperature @bottom_temperature end |
#charge ⇒ Float (readonly)
Returns Current charge percentage.
9 10 11 |
# File 'lib/mixergy/status.rb', line 9 def charge @charge end |
#current ⇒ Float (readonly)
Returns Current in Amps.
19 20 21 |
# File 'lib/mixergy/status.rb', line 19 def current @current end |
#frequency ⇒ Float (readonly)
Returns Frequency in Hz.
15 16 17 |
# File 'lib/mixergy/status.rb', line 15 def frequency @frequency end |
#top_temperature ⇒ Float (readonly)
Returns Top temperature in Celsius.
11 12 13 |
# File 'lib/mixergy/status.rb', line 11 def top_temperature @top_temperature end |
#voltage ⇒ Float (readonly)
Returns Voltage in Volts.
17 18 19 |
# File 'lib/mixergy/status.rb', line 17 def voltage @voltage end |