Class: OpenWeatherMap::City

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

Instance Method Summary collapse

Constructor Details

#initialize(country, city) ⇒ City

Returns a new instance of City.



7
8
9
10
# File 'lib/open_weather_map.rb', line 7

def initialize(country, city)
  params = { q: "#{country},#{city}" }
  @response = request params
end

Instance Method Details

#condObject



12
13
14
# File 'lib/open_weather_map.rb', line 12

def cond
  @response['weather'][0]['main']
end

#temp_maxObject



20
21
22
# File 'lib/open_weather_map.rb', line 20

def temp_max
  @response['main']['temp_max']
end

#temp_minObject



16
17
18
# File 'lib/open_weather_map.rb', line 16

def temp_min
  @response['main']['temp_min']
end