openweather2 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2928fc7bb5e1e2a33d0bab9262c2580e1870cf1b
4
- data.tar.gz: bae53bbc5263b753ec836a5fb3f479a97df4a32a
3
+ metadata.gz: 8ef3f8e41cba45a0f32e7fef1b9e04ff26a62468
4
+ data.tar.gz: 2c347a76100236c5ebce073b72545ad3bdc8c0d2
5
5
  SHA512:
6
- metadata.gz: 64ff8d5212e3b2d00a08dc6ed7f3b2afe1dab414faa901bd1258cbb87fbccd0590fd02428e7f491eff114ac4377769e3894bf7806744899306e21bfdccf05071
7
- data.tar.gz: fd29d80784491b4b6f882bcde125b9591ae55453a69911e6f0c5451dbf1ee0bd48b2bed3a0cb3d76ee7fadaf65cc1f46216812faa603f2310fadf65e1005671b
6
+ metadata.gz: 74725fc9f20473e27ac3e28b0a24cf75a946f37f8c8495aed506995cad72a66727c1d93a74bb9d4dcbfd8a60e3ed2b3d0f63d71a2e412eb2410446fa9e503dbd
7
+ data.tar.gz: a1d01c89957949d6b7850df12cc23da2aae4c66429a07dd4c8e064f85dd51f81dc36159136a0483e5c9c1bc00bbbdf183eeaaf3ec77f053584545428e6f35f4b
@@ -59,31 +59,5 @@ module Openweather2
59
59
  def default_params
60
60
  {:APPID => Openweather2.configuration.apikey }
61
61
  end
62
-
63
- def do_request(req)
64
- configure_required!
65
-
66
- endpoint_uri = URI(Openweather2.configuration.endpoint)
67
-
68
-
69
- http_params = [
70
- endpoint_uri.hostname,
71
- endpoint_uri.port,
72
- use_ssl: uri.scheme == 'https'
73
- ]
74
-
75
- res = Net::HTTP.start(*http_params) do |http|
76
- http.request(req)
77
- end
78
-
79
- case res
80
- when Net::HTTPSuccess
81
- JSON.parse(res.body)
82
- when Net::HTTPUnprocessableEntity
83
- raise UnprocessableError, "Bad URI param!"
84
- else
85
- raise UnknownResponse, "Something was wrong!"
86
- end
87
- end
88
62
 
89
63
  end
@@ -1,3 +1,3 @@
1
1
  module Openweather2
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -6,8 +6,8 @@ module Openweather2
6
6
 
7
7
  def initialize(json)
8
8
  @city = json['name']
9
- @longitude = json['coord']['lon']
10
- @latitude = json['coord']['lat']
9
+ @longitude = json['coord'] && json['coord']['lon']
10
+ @latitude = json['coord'] && json['coord']['lat']
11
11
  @temperature = Openweather2::Temperature.new(json['main']['temp'])
12
12
  @pressure = json['main']['pressure']
13
13
  @humidity = json['main']['humidity']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openweather2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Ocon