Class: OpenWeatherMap::City
- Inherits:
-
Object
- Object
- OpenWeatherMap::City
- Defined in:
- lib/open_weather_map.rb
Instance Method Summary collapse
- #cond ⇒ Object
-
#initialize(country, city) ⇒ City
constructor
A new instance of City.
- #temp_max ⇒ Object
- #temp_min ⇒ Object
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
#cond ⇒ Object
12 13 14 |
# File 'lib/open_weather_map.rb', line 12 def cond @response['weather'][0]['main'] end |
#temp_max ⇒ Object
20 21 22 |
# File 'lib/open_weather_map.rb', line 20 def temp_max @response['main']['temp_max'] end |
#temp_min ⇒ Object
16 17 18 |
# File 'lib/open_weather_map.rb', line 16 def temp_min @response['main']['temp_min'] end |