Class: Sensorpush::Sample
- Inherits:
-
Object
- Object
- Sensorpush::Sample
- Defined in:
- lib/sensorpush/sample.rb
Instance Attribute Summary collapse
-
#humidity ⇒ Object
Returns the value of attribute humidity.
-
#observed ⇒ Object
Returns the value of attribute observed.
-
#temperature ⇒ Object
Returns the value of attribute temperature.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Sample
constructor
A new instance of Sample.
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
#humidity ⇒ Object
Returns the value of attribute humidity.
7 8 9 |
# File 'lib/sensorpush/sample.rb', line 7 def humidity @humidity end |
#observed ⇒ Object
Returns the value of attribute observed.
9 10 11 |
# File 'lib/sensorpush/sample.rb', line 9 def observed @observed end |
#temperature ⇒ Object
Returns the value of attribute temperature.
8 9 10 |
# File 'lib/sensorpush/sample.rb', line 8 def temperature @temperature end |