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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tomorrowio_rb.rb +7 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a91cddf8a66a8d63b37ad6a199c2d494755b05c85640e3c34e79739f3469208
4
- data.tar.gz: 6f50f4ede3d86a55381db2974efe64c40ae7dd8444779bcf4538c92e7e4e7a55
3
+ metadata.gz: 755bdab30c734df598fc0b9de45f63fbc0dfbc6730dcbd560fa39c3cdfedd566
4
+ data.tar.gz: 04622c8355659e9ff0df021f5167c9a024325c5adf881856e2f746101edf566f
5
5
  SHA512:
6
- metadata.gz: 00c66a047772b6db156be94bf549469172ae8f45e946725f8f2f87fece6d300ef587a71b2bec1fb3655ec024e5967825953b1ee236e1b4a418ae894f16f5c669
7
- data.tar.gz: fb5a0a3f5ebc161b75ba10b867bc4db08510dc9a399758953a583c39988dcca7e5435f737c37dd45176d651fee65bb75a618a0b7c97a9b270628843a6291e70e
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=nil, units=nil)
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
- req.params['timesteps'] = timesteps if timesteps
19
- req.params['units'] = units if units
20
- response = connection.get('')
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.2
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-10-21 00:00:00.000000000 Z
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.