Skip to content

Commit

Permalink
bug: Hotfix wrong validation in forecast by city method
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-developer committed May 3, 2024
1 parent 8c826be commit 36e5a57
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/open_weather_aemet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def self.forecast_by_city(city_code, api_key)
api_url = "https://opendata.aemet.es/opendata/api/prediccion/especifica/municipio/diaria/#{city_code}"
response = ApiAemet::DataResponse.new(api_url: api_url, api_key: api_key).call

return "Invalid data" unless response.is_a?(Hash)
return "Invalid data" unless response.is_a?(Array)

three_forecast_days = response.first["prediccion"]["dia"][0..2]
forecast_result = []
Expand Down
Binary file modified open_weather_aemet-0.1.0.gem
Binary file not shown.

0 comments on commit 36e5a57

Please sign in to comment.