derecho 0.1.2 → 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/derecho/version.rb +1 -1
- data/lib/derecho.rb +46 -17
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5e69f12eb8d2097e7d86e724e3df331d35db223
|
4
|
+
data.tar.gz: 79ea89e09c6935d9aab4b92697f96f3e7abcec4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: febb08cd83f20e6901b8ccc10ada0b7045f1391b4011f6401efc777ce26a7bf8715c74ff7be1b1c2fd41eaf92caeb71a20e2ed3713355782f6a0a3ac949639bd
|
7
|
+
data.tar.gz: 7449d09c0cc1a447c7d0a8d5afa195ae9837610b76e94b727c8d05ba7121b11a0f57e4af4a53ab9bd4f425a001a6c4b7d8e8f138659e6d79008c6125b1c47ba4
|
data/lib/derecho/version.rb
CHANGED
data/lib/derecho.rb
CHANGED
@@ -19,31 +19,60 @@ class Derecho
|
|
19
19
|
response["forecast"].to_a
|
20
20
|
end
|
21
21
|
|
22
|
-
def get_advanced_weather_data
|
23
|
-
daily_forecast_two = response[1][1]["forecastday"]
|
24
|
-
daily_forecast_two.each do |day|
|
25
|
-
weekday = day["date"]["weekday"]
|
26
|
-
condition = day["conditions"]
|
27
|
-
temp_high = day["high"]["fahrenheit"]
|
28
|
-
temp_low = day["low"]["fahrenheit"]
|
29
|
-
icon = day["icon"]
|
30
|
-
icon_img = day["icon_url"]
|
31
|
-
|
32
|
-
puts "#{weekday} will be #{condition} with a high of #{temp_high} and a low of #{temp_low}."
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
22
|
def get_basic_weather_data
|
23
|
+
results = []
|
37
24
|
daily_forecast = response[0][1]["forecastday"]
|
38
25
|
daily_forecast.each do |day|
|
39
26
|
if day["title"].length <= 10
|
40
27
|
weather = []
|
41
28
|
day_string = day["title"].split(' ')
|
42
|
-
|
29
|
+
results.push("#{day_string[0]} will be #{day["fcttext"]}")
|
43
30
|
end
|
44
31
|
end
|
32
|
+
results
|
33
|
+
end
|
34
|
+
|
35
|
+
def get_weekday
|
36
|
+
results = []
|
37
|
+
daily_forecast = response[1][1]["forecastday"]
|
38
|
+
daily_forecast.each do |day|
|
39
|
+
days = day["date"]["weekday"]
|
40
|
+
|
41
|
+
results.push(days)
|
42
|
+
end
|
43
|
+
results
|
44
|
+
end
|
45
|
+
|
46
|
+
def get_icon
|
47
|
+
results = []
|
48
|
+
daily_forecast = response[1][1]["forecastday"]
|
49
|
+
daily_forecast.each do |day|
|
50
|
+
icons = day["icon_url"]
|
51
|
+
|
52
|
+
results.push(icons)
|
53
|
+
end
|
54
|
+
results
|
45
55
|
end
|
46
56
|
|
47
|
-
|
48
|
-
|
57
|
+
def get_daily_highs
|
58
|
+
results = []
|
59
|
+
daily_forecast = response[1][1]["forecastday"]
|
60
|
+
daily_forecast.each do |day|
|
61
|
+
temp_high = day["high"]["fahrenheit"]
|
62
|
+
|
63
|
+
results.push(temp_high)
|
64
|
+
end
|
65
|
+
results
|
66
|
+
end
|
67
|
+
|
68
|
+
def get_daily_lows
|
69
|
+
results = []
|
70
|
+
daily_forecast = response[1][1]["forecastday"]
|
71
|
+
daily_forecast.each do |day|
|
72
|
+
temp_low = day["low"]["fahrenheit"]
|
73
|
+
|
74
|
+
results.push(temp_low)
|
75
|
+
end
|
76
|
+
results
|
77
|
+
end
|
49
78
|
end
|