Class: NestWrapper::Device
- Inherits:
-
Object
- Object
- NestWrapper::Device
- Defined in:
- lib/nest_wrapper/device.rb
Instance Attribute Summary collapse
-
#config_data ⇒ Object
Returns the value of attribute config_data.
-
#country ⇒ Object
Returns the value of attribute country.
-
#name ⇒ Object
Returns the value of attribute name.
-
#state ⇒ Object
Returns the value of attribute state.
-
#zip ⇒ Object
Returns the value of attribute zip.
Instance Method Summary collapse
-
#initialize(status) ⇒ Device
constructor
A new instance of Device.
Constructor Details
#initialize(status) ⇒ Device
Returns a new instance of Device.
5 6 7 8 9 10 11 12 |
# File 'lib/nest_wrapper/device.rb', line 5 def initialize(status) self.name = NestWrapper.nest.status['structure'][NestWrapper.nest.status['structure'].keys.first]['name'] self.zip = NestWrapper.nest.status['structure'][NestWrapper.nest.status['structure'].keys.first]['postal_code'] self.country = NestWrapper.nest.status['structure'][NestWrapper.nest.status['structure'].keys.first]['country_code'] self.config_data = NestWrapper.nest.status['device'][NestWrapper.nest.status['device'].keys.first] self.state = NestWrapper::State.new(status) end |
Instance Attribute Details
#config_data ⇒ Object
Returns the value of attribute config_data.
3 4 5 |
# File 'lib/nest_wrapper/device.rb', line 3 def config_data @config_data end |
#country ⇒ Object
Returns the value of attribute country.
3 4 5 |
# File 'lib/nest_wrapper/device.rb', line 3 def country @country end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/nest_wrapper/device.rb', line 3 def name @name end |
#state ⇒ Object
Returns the value of attribute state.
3 4 5 |
# File 'lib/nest_wrapper/device.rb', line 3 def state @state end |
#zip ⇒ Object
Returns the value of attribute zip.
3 4 5 |
# File 'lib/nest_wrapper/device.rb', line 3 def zip @zip end |