class OpenWeatherMap::Client
- OpenWeatherMap::Client
- Reference
- Object
Overview
A client for interfacing with the Open Weather Map API.
Defined in:
open_weather_map/client.crConstructors
Instance Method Summary
-
#current_weather_for_cities(params : Hash(String, _))
Requests current weather information for multiple cities by passing in required parameters as a hash.
-
#current_weather_for_city(params : Hash(String, _))
Requests current weather information for a single city by passing in required parameters as a hash.
-
#five_day_forecast_for_city(params : Hash(String, _))
Requests 5 day/3 hour weather forecast for a single city by passing in required parameters as a hash.
-
#sunrise_sunset_for_city(params : Hash(String, _))
Requests sunrise and sunset times for a single city by passing in required parameters as a hash.
Constructor Detail
Instance Method Detail
Requests current weather information for multiple cities by passing in required parameters as a hash. The Hash must have one of the following sets of keys: lat, lon, cnt : Query for cnt number of cities nearest to the lat and lon coordinates provided. bbox : Query for all cities within a rectangle of coordinates provided. id : Query by a list of city IDs.
Requests current weather information for a single city by passing in required parameters as a hash. The Hash must have one of the following sets of keys: q : Querying by the city name. id : Querying by the city ID. lat & lon : Querying by latitudinal and longitudinal values. zip : For American addresses, querying by the zip code.
Requests 5 day/3 hour weather forecast for a single city by passing in required parameters as a hash. The Hash must have one of the following sets of keys: q : Querying by the city name. id : Querying by the city ID. lat & lon : Querying by latitudinal and longitudinal values. zip : For American addresses, querying by the zip code.
Requests sunrise and sunset times for a single city by passing in required parameters as a hash. The Hash must have one of the following sets of keys: q : Querying by the city name. id : Querying by the city ID. lat & lon : Querying by latitudinal and longitudinal values. zip : For American addresses, querying by the zip code.