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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/everything.rb +4 -2
  3. data/lib/news-api.rb +3 -3
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd5215bcc1a28d4b59e264337cffdf558e6b18036479b10240372d7a4fd41430
4
- data.tar.gz: 47e17904d3c4debf2aade8bd56d5e8381786fbe2545aeaf7ff559755afc8352a
3
+ metadata.gz: 03ba11ff501688faf0ef80cf8120b30386828967cb04ea388acc20856b86d4d8
4
+ data.tar.gz: b454e1d354e8ed465d4ed2433dc9e85dcd80b92f1af248f1c07b5edec5699691
5
5
  SHA512:
6
- metadata.gz: ca1d62a5c07a56720e5380d5d11bea55013bda438ad505e9e142762e0c3ebeb8cd998fef02d63013fb4a445a3c8f9cb69797d87db4c9cbb3d9c6cc4b7e5c223d
7
- data.tar.gz: 7e04de47a424375441c4bb34d13452813d7a8284c6191b30e73ac179da38248dbe574a6b3ed0d0da920506404c10ac025792c2e1e0fc4e801938fa9d5b4c0ead
6
+ metadata.gz: ea4036b07a66ac2fb44c45b756f0f770aad7e1a0455db60ed49299bd469525622bf183f11b11acbb0154491f8929ff25ab21f591eab6fd8608820b10434b8d8c
7
+ data.tar.gz: 3c3ec36e3962c46e164d3650f4bc21e993d9ca9570504297520c72c275dfb954879134eed2c91e4d6b0ce4bdfbeb117bd59530dfd5e03a41a0ed13bbec9fd6d3
@@ -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
@@ -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.1.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-06-25 00:00:00.000000000 Z
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