open-meteo 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/open_meteo/forecast.rb +5 -2
- data/lib/open_meteo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c6c6b4ccb93360c8c3f27479f8bc01cc5cc37a7d14f2ff6942d745e3bd243a8
|
4
|
+
data.tar.gz: e10768db1766c5c7a48f8c68e6b15d2e367aefa0dc1bc3fc9a3fa263ce7cca93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 966bbb364b37dc3e4fe846516f862216c172e242949b5b64d45afded542336f704904e6725b7fcb867de0481a23988789c4392f7480c62dc24491d62b65740fa
|
7
|
+
data.tar.gz: 694c506e84309461346622763b562f34cd9f11d6fb34d7ab81b25faa7a808298cc07ecb58e02765ae9abd8a80b4122df388f9a57d657b7b63131e7cda07008ee
|
data/lib/open_meteo/forecast.rb
CHANGED
@@ -12,8 +12,9 @@ module OpenMeteo
|
|
12
12
|
class WrongLocationType < StandardError
|
13
13
|
end
|
14
14
|
|
15
|
-
def initialize(client: OpenMeteo::Client.new)
|
15
|
+
def initialize(client: OpenMeteo::Client.new, response_wrapper: OpenMeteo::ResponseWrapper.new)
|
16
16
|
@client = client
|
17
|
+
@response_wrapper = response_wrapper
|
17
18
|
end
|
18
19
|
|
19
20
|
def get(location:, variables:, model: :general)
|
@@ -49,7 +50,9 @@ module OpenMeteo
|
|
49
50
|
|
50
51
|
def get_forecast(endpoint, location, variables)
|
51
52
|
get_params = { **location.to_get_params, **variables.to_get_params }
|
52
|
-
client.get(endpoint, **get_params)
|
53
|
+
response = client.get(endpoint, **get_params)
|
54
|
+
|
55
|
+
@response_wrapper.wrap(response, entity: OpenMeteo::Entities::Forecast)
|
53
56
|
end
|
54
57
|
end
|
55
58
|
end
|
data/lib/open_meteo/version.rb
CHANGED