Class: Netatmo::Place
- Inherits:
-
Object
- Object
- Netatmo::Place
- Defined in:
- lib/netatmo/place.rb
Instance Attribute Summary collapse
-
#altitude ⇒ Object
Returns the value of attribute altitude.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#location ⇒ Object
Returns the value of attribute location.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
Instance Method Summary collapse
-
#initialize(data) ⇒ Place
constructor
A new instance of Place.
Constructor Details
#initialize(data) ⇒ Place
Returns a new instance of Place.
9 10 11 12 13 14 15 16 17 |
# File 'lib/netatmo/place.rb', line 9 def initialize(data) return if data.nil? self.altitude = data['altitude'] self.city = data['city'] self.country = data['country'] self.timezone = data['timezone'] self.location = ::Geocoder.search(data['location'].reverse) end |
Instance Attribute Details
#altitude ⇒ Object
Returns the value of attribute altitude.
7 8 9 |
# File 'lib/netatmo/place.rb', line 7 def altitude @altitude end |
#city ⇒ Object
Returns the value of attribute city.
7 8 9 |
# File 'lib/netatmo/place.rb', line 7 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
7 8 9 |
# File 'lib/netatmo/place.rb', line 7 def country @country end |
#location ⇒ Object
Returns the value of attribute location.
7 8 9 |
# File 'lib/netatmo/place.rb', line 7 def location @location end |
#timezone ⇒ Object
Returns the value of attribute timezone.
7 8 9 |
# File 'lib/netatmo/place.rb', line 7 def timezone @timezone end |