You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before writing this OpenWeatherMap implementation, I checked for existing ones on rubygems.org. There's only small libraries, that has at least one or two good thing but that's all. Consequently, I decided to make my own one, combining all their advantages :
11
+
12
+
-**Centralized :** all the options and fetch methods are stored in one class, that is initialized only once in all the program. Parameters are the same across all requests.
13
+
-**Fast :** the only thing that can slow the library is your Internet connection : indeed, no heavy operations are made in the background. As soon as it receives weather conditions, the only step for it is organizing them.
14
+
-**Simple :** the library only contains essential operations to keep the number of methods low. Moreover, all the information is perfectly human-readable.
15
+
-**Documented :** every method and class attribute is explained and every exception thrown is explicit, therefore learning or debugging the library remains easy.
16
+
17
+
This work resulted in a powerful implementation that responds to primary needs while staying abordable.
18
+
8
19
-[📌 Requirements](#-requirements)
9
20
-[🔧 Setup](#-setup)
10
21
-[Quick installation](#quick-installation)
@@ -90,7 +101,7 @@ The constructor takes three parameters :
90
101
- The first is an API key, that can be generated on the [OpenWeatherMap website](https://openweathermap.org/appid)
91
102
- The second is the language of the data. It can be one of these : Arabic - ar, Bulgarian - bg, Catalan - ca, Czech - cz, German - de, Greek - el, English - en, Persian (Farsi) - fa, Finnish - fi, French - fr, Galician - gl, Croatian - hr, Hungarian - hu, Italian - it, Japanese - ja, Korean - kr, Latvian - la, Lithuanian - lt, Macedonian - mk, Dutch - nl, Polish - pl, Portuguese - pt, Romanian - ro, Russian - ru, Swedish - se, Slovak - sk, Slovenian - sl, Spanish - es, Turkish - tr, Ukrainian - ua, Vietnamese - vi, Chinese Simplified - zh_cn, Chinese Traditional - zh_tw.
92
103
- The third is the unit system. It can be one of these :
93
-
-none (temperatures in Kelvin)
104
+
-default (temperatures in Kelvin)
94
105
- metric (temperatures in Celsius)
95
106
- imperial (temperatures in Fahrenheit)
96
107
@@ -122,7 +133,7 @@ Its parameter is the same as the `current` method. It will return a `OpenWeather
122
133
123
134
### Possible exceptions
124
135
125
-
Your requests may return exceptions that are in the `OpenWeatherMap::Exceptions` module :
136
+
Your requests may return exceptions that are in the `OpenWeatherMap::Exceptions` module. All are based on the `OpenWeatherMap::Exception` class.
126
137
127
138
- An `Unauthorized` exception, caused when your API key is wrong
128
139
- An `UnknownLocation` exception, caused if the location you wrote is wrong
0 commit comments