Class: Sensorpush::Sample

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Sample

Returns a new instance of Sample.



11
12
13
14
15
# File 'lib/sensorpush/sample.rb', line 11

def initialize(attributes = {})
  self.humidity = attributes["humidity"]
  self.temperature = attributes["temperature"]
  self.observed = DateTime.parse(attributes["observed"])
end

Instance Attribute Details

#humidityObject

Returns the value of attribute humidity.



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

def humidity
  @humidity
end

#observedObject

Returns the value of attribute observed.



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

def observed
  @observed
end

#temperatureObject

Returns the value of attribute temperature.



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

def temperature
  @temperature
end