Class: Sensorpush::Sensor
- Inherits:
-
Object
- Object
- Sensorpush::Sensor
- Defined in:
- lib/sensorpush/sensor.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#address ⇒ Object
Returns the value of attribute address.
-
#battery_voltage ⇒ Object
Returns the value of attribute battery_voltage.
-
#device_id ⇒ Object
Returns the value of attribute device_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Sensor
constructor
A new instance of Sensor.
Constructor Details
#initialize(attributes = {}) ⇒ Sensor
Returns a new instance of Sensor.
12 13 14 15 16 17 18 19 |
# File 'lib/sensorpush/sensor.rb', line 12 def initialize(attributes = {}) self.active = attributes["active"] self.name = attributes["name"] self.address = attributes["address"] self.battery_voltage = attributes["battery_voltage"] self.id = attributes["id"] self.device_id = attributes["deviceId"] end |
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
5 6 7 |
# File 'lib/sensorpush/sensor.rb', line 5 def active @active end |
#address ⇒ Object
Returns the value of attribute address.
7 8 9 |
# File 'lib/sensorpush/sensor.rb', line 7 def address @address end |
#battery_voltage ⇒ Object
Returns the value of attribute battery_voltage.
8 9 10 |
# File 'lib/sensorpush/sensor.rb', line 8 def battery_voltage @battery_voltage end |
#device_id ⇒ Object
Returns the value of attribute device_id.
10 11 12 |
# File 'lib/sensorpush/sensor.rb', line 10 def device_id @device_id end |
#id ⇒ Object
Returns the value of attribute id.
9 10 11 |
# File 'lib/sensorpush/sensor.rb', line 9 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/sensorpush/sensor.rb', line 6 def name @name end |