class OWM::Client
- OWM::Client
- Reference
- Object
Overview
A client for interfacing with the Open Weather Map API.
Defined in:
owm/client.crConstructors
Instance Method Summary
-
#current_weather_for_cities(params : Hash(String, _)) : Array(CurrentWeather)
Requests current weather information for multiple cities by passing in required parameters as a hash.
-
#current_weather_for_city(params : Hash(String, _)) : CurrentWeather
Requests current weather information for a single city by passing in required parameters as a hash.
-
#five_day_forecast_for_city(params : Hash(String, _)) : FiveDayForecast
Requests 5 day/3 hour weather forecast for a single city by passing in required parameters as a hash.
-
#one_call(params : Hash(String, _)) : OneCall
Requests data from OpenWeatherMap's (OneCall API)[https://openweathermap.org/api/one-call-api] with latitude and longitude for location.
-
#sunrise_sunset_for_city(params : Hash(String, _)) : Array(Time)
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 data from OpenWeatherMap's (OneCall API)[https://openweathermap.org/api/one-call-api] with latitude and longitude for location.
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.