Class: Sensorpush::Sensor

Inherits:
Object
  • Object
show all
Defined in:
lib/sensorpush/sensor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#activeObject

Returns the value of attribute active.



5
6
7
# File 'lib/sensorpush/sensor.rb', line 5

def active
  @active
end

#addressObject

Returns the value of attribute address.



7
8
9
# File 'lib/sensorpush/sensor.rb', line 7

def address
  @address
end

#battery_voltageObject

Returns the value of attribute battery_voltage.



8
9
10
# File 'lib/sensorpush/sensor.rb', line 8

def battery_voltage
  @battery_voltage
end

#device_idObject

Returns the value of attribute device_id.



10
11
12
# File 'lib/sensorpush/sensor.rb', line 10

def device_id
  @device_id
end

#idObject

Returns the value of attribute id.



9
10
11
# File 'lib/sensorpush/sensor.rb', line 9

def id
  @id
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/sensorpush/sensor.rb', line 6

def name
  @name
end