yr_weather 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yr_weather.rb +7 -4
- 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: 5c2135e04382c61a18b28add359d42d910241a0950356bab5aab95b2f74515d7
|
4
|
+
data.tar.gz: e8f5e71ffda302e393a411d9e754eae247f2942484948d6b22e9bd755342ec6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de545aaac5e3c66c25aa69bbb6cd422e83e35ef669123ceef9cd95574fa1fd645b56e82f2bf947859a27abed74f273fc32aa32f35ce92065d055bf6ffd13c8c3
|
7
|
+
data.tar.gz: 8df88026d653594a00c6f9b448ad5186d50f8d4550bd46af1a513a37cbb8a30344f6483a2addf6c094d5a5d8e8b28343a6408af9d6d2ef581aa17da90dc0ddb8
|
data/lib/yr_weather.rb
CHANGED
@@ -177,7 +177,8 @@ class YrWeather
|
|
177
177
|
nodes[t + i*6*60*60]
|
178
178
|
end.compact.map do |node|
|
179
179
|
{
|
180
|
-
|
180
|
+
from: node.dig(:time),
|
181
|
+
to: node.dig(:time) + 6*60*60,
|
181
182
|
temperature_maximum: node.dig(:data, :next_6_hours, :details, :air_temperature_max),
|
182
183
|
temperature_minimum: node.dig(:data, :next_6_hours, :details, :air_temperature_min),
|
183
184
|
wind_speed_max: node.dig(:data, :instant, :details, :wind_speed),
|
@@ -194,7 +195,7 @@ class YrWeather
|
|
194
195
|
8.times.map do |day|
|
195
196
|
start = @start_of_day + day*24*60*60
|
196
197
|
range = start..(start + 24*60*60)
|
197
|
-
forecast(range).merge(
|
198
|
+
forecast(range).merge(from: start, to: start + 24*60*60)
|
198
199
|
end
|
199
200
|
end
|
200
201
|
|
@@ -210,7 +211,8 @@ class YrWeather
|
|
210
211
|
}
|
211
212
|
end
|
212
213
|
results = {
|
213
|
-
|
214
|
+
from: [],
|
215
|
+
to: [],
|
214
216
|
temperature: [],
|
215
217
|
wind_speed: [],
|
216
218
|
wind_speed_knots: [],
|
@@ -219,7 +221,8 @@ class YrWeather
|
|
219
221
|
}
|
220
222
|
points.each do |point|
|
221
223
|
point[:hours].times do |i|
|
222
|
-
results[:
|
224
|
+
results[:from] << point[:at] + i*60*60
|
225
|
+
results[:to] << point[:at] + (i+1)*60*60
|
223
226
|
results[:temperature] << point[:temperature]
|
224
227
|
results[:wind_speed] << point[:wind_speed]
|
225
228
|
results[:wind_speed_knots] << to_knots(point[:wind_speed])
|