Class: Netatmo::Place

Inherits:
Object
  • Object
show all
Defined in:
lib/netatmo/place.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#altitudeObject

Returns the value of attribute altitude.



7
8
9
# File 'lib/netatmo/place.rb', line 7

def altitude
  @altitude
end

#cityObject

Returns the value of attribute city.



7
8
9
# File 'lib/netatmo/place.rb', line 7

def city
  @city
end

#countryObject

Returns the value of attribute country.



7
8
9
# File 'lib/netatmo/place.rb', line 7

def country
  @country
end

#locationObject

Returns the value of attribute location.



7
8
9
# File 'lib/netatmo/place.rb', line 7

def location
  @location
end

#timezoneObject

Returns the value of attribute timezone.



7
8
9
# File 'lib/netatmo/place.rb', line 7

def timezone
  @timezone
end