A wrapper for the openweather API. Built upon Faraday http client. A demo of OOP.
OOP with use of Strategy patterns, Factory pattern and delegation(from class to instance).
Open/Closed Principle: each new forecast type (5 days, 10 days etc ...) can be easily add with the factory service_builder_factory. Which uses factories defined in a file current_uri_builder. Current is the current type forecast(24h).
Service call -> get on wrapper weather_service -> get on Faraday connection connection object
Also:
- Use of Turbo/Hotwire
- index.html.slim link via weatherData id div
- weather_controller only this partial is reloaded on search.
- Bulma CSS for the front-end + slim
- Configuration/secret: figaro & .gitignore
- Skinny controller: use of a service
- locales
- helpers
Demo live at Heroku