covid 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35923fa3834ae014ca0219955ff2dc0e2ddb7bc0c655893bac3119ffd5dec718
4
- data.tar.gz: b0f6390ab836cc3ea7a8043e2e6fb24072d1e19e76b298074d6aa835d76966e8
3
+ metadata.gz: a2099228c9a0f68b98b56c76ffff63d6984f768e82c4e9b26263b604a0edad60
4
+ data.tar.gz: 176e67394bbed59fff11aca59551f9ce7b5b57d3eb6701e3b1a59150a930966c
5
5
  SHA512:
6
- metadata.gz: a6c619fe85383eb53c8a5e6d52440ed47789d17349753a9c3a118f7f43e28a053d355d1cb49b346bcef93e244f03a507be9e202cc9cb1dcdc13e8c787451f3c7
7
- data.tar.gz: 76c93830dfc16a39fdd332176c93f26de6fb7d9ec36e07e6786487f4352ca941c45d2c24640e08d7f81972b2c9bea104bf39a489c52fa7cb4fbebd5a7b2702a9
6
+ metadata.gz: b0f444134263754c8a8de6ebf3f79a2cb38671a488379a61d7c2e75ce1e4877b010513770f76bd2891c920aa2242ef9c92ee1eb126e269fdeb1b97595034d48a
7
+ data.tar.gz: 15510d828dfa6854693d53304b8158e603476047dd2450f85264718986b63e13c9a484684ae29997a9af447d4c87c6e9e0011c20fd075c17c3266b76b7ae661a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- covid (0.1.1)
4
+ covid (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -7,7 +7,7 @@ JSON wrapper around [Johns Hopkins dataset](https://github.com/CSSEGISandData/CO
7
7
  Add this line to your application's Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'covid'
10
+ gem "covid"
11
11
  ```
12
12
 
13
13
  And then execute:
@@ -21,15 +21,9 @@ Or install it yourself as:
21
21
  ## Usage
22
22
 
23
23
  ```
24
- $ puts Covid::Nineteen.confirmed
25
- ```
26
-
27
- ```
28
- $ puts Covid::Nineteen.deaths
29
- ```
30
-
31
- ```
32
- $ puts Covid::Nineteen.recovered
24
+ $ Covid::Nineteen.confirmed
25
+ $ Covid::Nineteen.deaths
26
+ $ Covid::Nineteen.recovered
33
27
  ```
34
28
 
35
29
 
@@ -18,7 +18,7 @@ module Covid
18
18
  end
19
19
 
20
20
  def run
21
- csv.map(&:to_h).to_json
21
+ parsed_json
22
22
  end
23
23
 
24
24
  def self.confirmed
@@ -39,10 +39,18 @@ module Covid
39
39
  CSV.parse(response, headers: true)
40
40
  end
41
41
 
42
+ def raw
43
+ csv.map(&:to_h).to_json
44
+ end
45
+
42
46
  def response
43
47
  Net::HTTP.get(uri)
44
48
  end
45
49
 
50
+ def parsed_json
51
+ JSON.parse(raw)
52
+ end
53
+
46
54
  def uri
47
55
  URI(BASE_URI + @path)
48
56
  end
@@ -1,3 +1,3 @@
1
1
  module Covid
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: covid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Thom