tomorrowio_rb 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tomorrowio_rb.rb +7 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 755bdab30c734df598fc0b9de45f63fbc0dfbc6730dcbd560fa39c3cdfedd566
|
4
|
+
data.tar.gz: 04622c8355659e9ff0df021f5167c9a024325c5adf881856e2f746101edf566f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e9f005bb58ccb7ee7f5d913d0f218b10305a347e32b6aca9403a4b8b531f246b751cf850c099b6237d6e3c308ecb9c28f0955a859d2e1987fd3bc610037fc38
|
7
|
+
data.tar.gz: 801927921423c19038d5c2d72451f71ce262ebb78cb5242d44d158b56061d05c4e0bfc54e9b5a2a8faad5e2165376d0e69ba24ef76c2081a03d753da517bcc83
|
data/lib/tomorrowio_rb.rb
CHANGED
@@ -6,7 +6,7 @@ module Tomorrowiorb
|
|
6
6
|
extend Configuration
|
7
7
|
|
8
8
|
class << self
|
9
|
-
def forecast(location, timesteps=
|
9
|
+
def forecast(location, timesteps=["1d"], units="metric")
|
10
10
|
connection = Faraday.new(
|
11
11
|
url: "#{Tomorrowiorb.api_endpoint}/weather/forecast",
|
12
12
|
params: {
|
@@ -15,9 +15,11 @@ module Tomorrowiorb
|
|
15
15
|
},
|
16
16
|
headers: {'Content-Type' => 'application/json'}
|
17
17
|
)
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
response = connection.get('') do |req|
|
19
|
+
req.options.params_encoder = Faraday::FlatParamsEncoder
|
20
|
+
req.params['timesteps'] = timesteps
|
21
|
+
req.params['units'] = units
|
22
|
+
end
|
21
23
|
|
22
24
|
return TomorrowioResponse.new(response.status,response.headers, response.body)
|
23
25
|
end
|
@@ -42,4 +44,4 @@ module Tomorrowiorb
|
|
42
44
|
@body
|
43
45
|
end
|
44
46
|
end
|
45
|
-
end
|
47
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tomorrowio_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cedric Wille
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby wrapper for the Tomorrow.io weather API, currently only the forecast
|
14
14
|
endpoint.
|