newsarchives 0.0.0 → 0.0.1

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/newsarchives.rb +16 -18
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f72d5451c589b8202ac179e3e583351b7c0c909
4
- data.tar.gz: a35e87361362e352f0252d495f6dea0c3446eaee
3
+ metadata.gz: 17bf08f74555396d6c74c9f26d70f6129dd81569
4
+ data.tar.gz: ed128d51ba4ed98dde12ae06e82040c4ff7effdd
5
5
  SHA512:
6
- metadata.gz: 571fd1282128068126a8a809d8afa3e2774c53c55165dafec8c2dc97fff5e4924c187778a088a715fbbbfe753c3a79219aa47a4a8ae64becf2a5a054f2121f33
7
- data.tar.gz: 51bd1d4cca962ef44688b11b6bcd9ef788c8c91b56df57445a68737325a11548130253edc9625dc44926a88eb8dbb7fdb5d09938e35cd30e26d6305c137c58e2
6
+ metadata.gz: 32c0a2120611b46ff893c1b585feef0d942b7bbb359b8c0e9d5776055743acf5087ba7ed63b109fb2f46a911d3e3310d6fa2d2fc8197e8df439c4e33a70fdd07
7
+ data.tar.gz: 2623b39d23289118a1931d2e7e1bbd562c79872fac6c986f931c2bf9d881963a9db0914e1bbc14ffaedf01d50cdc59bb25817e4c1eac4cbc4bafd767438cd4c6
@@ -10,25 +10,23 @@ Github: https://github.com/gadhagod/News-Archives
10
10
  require 'net/http'
11
11
  require 'json'
12
12
 
13
- class NewsArchives
14
- def req(endpoint)
15
- response = Net::HTTP.get_response(URI.parse('https://newsarchives.herokuapp.com/' + endpoint))
16
- return JSON.parse(response.body)
17
- end
13
+ def req(endpoint)
14
+ response = Net::HTTP.get_response(URI.parse('https://newsarchives.herokuapp.com/' + endpoint))
15
+ return JSON.parse(response.body)
16
+ end
18
17
 
19
- class Time
20
- def day(day)
21
- return req('/day/' + day)
22
- end
23
- def month(month)
24
- return req('/month/' + month)
25
- end
26
- def year(year)
27
- return req('/year/' + year)
28
- end
18
+ class Time
19
+ def day(day)
20
+ return req('/day/' + day)
29
21
  end
30
-
31
- def keyword(keyword)
32
- return req('/keyword/' + keyword)
22
+ def month(month)
23
+ return req('/month/' + month)
24
+ end
25
+ def year(year)
26
+ return req('/year/' + year)
33
27
  end
34
28
  end
29
+
30
+ def keyword(keyword)
31
+ return req('/keyword/' + keyword)
32
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newsarchives
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aarav Borthakur