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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -10
- data/lib/covid.rb +9 -1
- data/lib/covid/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2099228c9a0f68b98b56c76ffff63d6984f768e82c4e9b26263b604a0edad60
|
4
|
+
data.tar.gz: 176e67394bbed59fff11aca59551f9ce7b5b57d3eb6701e3b1a59150a930966c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0f444134263754c8a8de6ebf3f79a2cb38671a488379a61d7c2e75ce1e4877b010513770f76bd2891c920aa2242ef9c92ee1eb126e269fdeb1b97595034d48a
|
7
|
+
data.tar.gz: 15510d828dfa6854693d53304b8158e603476047dd2450f85264718986b63e13c9a484684ae29997a9af447d4c87c6e9e0011c20fd075c17c3266b76b7ae661a
|
data/Gemfile.lock
CHANGED
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
|
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
|
-
$
|
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
|
|
data/lib/covid.rb
CHANGED
@@ -18,7 +18,7 @@ module Covid
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def run
|
21
|
-
|
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
|
data/lib/covid/version.rb
CHANGED