derecho 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/derecho/version.rb +1 -1
  3. data/lib/derecho.rb +46 -17
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51bb8931801163091763dbfea2844b9334c01732
4
- data.tar.gz: 298e8d15ed066e2d817698f248f1814d5ab87bd9
3
+ metadata.gz: e5e69f12eb8d2097e7d86e724e3df331d35db223
4
+ data.tar.gz: 79ea89e09c6935d9aab4b92697f96f3e7abcec4a
5
5
  SHA512:
6
- metadata.gz: d2b77e7cb616cf8bdf3651712d3755671687a005ac9e61ebc1f8f8f3f59b3b025a6c24573db16be91ab752636e61d1c383ab3ff21efc55fa1d25e90e995be5fa
7
- data.tar.gz: 991ca6ab9cee001fbeb34f8a4ec2a24c435b643f519470a631e128a6020c02d72dde211a410b7aec9976f2f6fc9b59df0d4c7d54738852ca60d8b39d7e23b877
6
+ metadata.gz: febb08cd83f20e6901b8ccc10ada0b7045f1391b4011f6401efc777ce26a7bf8715c74ff7be1b1c2fd41eaf92caeb71a20e2ed3713355782f6a0a3ac949639bd
7
+ data.tar.gz: 7449d09c0cc1a447c7d0a8d5afa195ae9837610b76e94b727c8d05ba7121b11a0f57e4af4a53ab9bd4f425a001a6c4b7d8e8f138659e6d79008c6125b1c47ba4
@@ -1,3 +1,3 @@
1
1
  module Derecho
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
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
- puts "#{day_string[0]} will be #{day["fcttext"]}"
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
- # Derecho.new("long beach", "ms").get_advanced_weather_data
48
- # Derecho.new("new orleans", "la").get_basic_weather_data
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: derecho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Waguespack