news-api 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/everything.rb +4 -2
- data/lib/news-api.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03ba11ff501688faf0ef80cf8120b30386828967cb04ea388acc20856b86d4d8
|
4
|
+
data.tar.gz: b454e1d354e8ed465d4ed2433dc9e85dcd80b92f1af248f1c07b5edec5699691
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea4036b07a66ac2fb44c45b756f0f770aad7e1a0455db60ed49299bd469525622bf183f11b11acbb0154491f8929ff25ab21f591eab6fd8608820b10434b8d8c
|
7
|
+
data.tar.gz: 3c3ec36e3962c46e164d3650f4bc21e993d9ca9570504297520c72c275dfb954879134eed2c91e4d6b0ce4bdfbeb117bd59530dfd5e03a41a0ed13bbec9fd6d3
|
data/lib/everything.rb
CHANGED
@@ -4,18 +4,20 @@ class Everything
|
|
4
4
|
attr_accessor :author
|
5
5
|
attr_accessor :title
|
6
6
|
attr_accessor :description
|
7
|
+
attr_accessor :content
|
7
8
|
attr_accessor :url
|
8
9
|
attr_accessor :urlToImage
|
9
10
|
attr_accessor :publishedAt
|
10
11
|
|
11
|
-
def initialize(source, author, title, description, url, urlToImage, publishedAt)
|
12
|
+
def initialize(source, author, title, description, content, url, urlToImage, publishedAt)
|
12
13
|
@id = source["id"]
|
13
14
|
@name = source["name"]
|
14
15
|
@author = author
|
15
16
|
@title = title
|
16
17
|
@description = description
|
18
|
+
@content = content
|
17
19
|
@url = url
|
18
20
|
@urlToImage = urlToImage
|
19
21
|
@publishedAt = publishedAt
|
20
22
|
end
|
21
|
-
end
|
23
|
+
end
|
data/lib/news-api.rb
CHANGED
@@ -10,7 +10,7 @@ class News
|
|
10
10
|
BASE_URL = 'https://newsapi.org/' + VERSION + '/'
|
11
11
|
|
12
12
|
def initialize(api_key)
|
13
|
-
@api_key = api_key
|
13
|
+
@api_key = api_key
|
14
14
|
end
|
15
15
|
|
16
16
|
def get_top_headlines(**args)
|
@@ -80,11 +80,11 @@ class News
|
|
80
80
|
data.push(
|
81
81
|
Everything.new(
|
82
82
|
a["source"], a["author"], a["title"],
|
83
|
-
a["description"], a["url"],
|
83
|
+
a["description"], a["content"], a["url"],
|
84
84
|
a["urlToImage"], a["publishedAt"]
|
85
85
|
)
|
86
86
|
)
|
87
87
|
end
|
88
88
|
return data
|
89
89
|
end
|
90
|
-
end
|
90
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: news-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Mikhnovich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: News API SDK gem
|
14
14
|
email: oleg5966346@gmail.com
|