Class: NewsApiAttributes
- Inherits:
-
Object
- Object
- NewsApiAttributes
- Defined in:
- lib/news_api_attributes.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#publishedAt ⇒ Object
Returns the value of attribute publishedAt.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
-
#urlToImage ⇒ Object
Returns the value of attribute urlToImage.
Instance Method Summary collapse
-
#initialize(source, author, title, description, url, urlToImage, publishedAt) ⇒ NewsApiAttributes
constructor
A new instance of NewsApiAttributes.
Constructor Details
#initialize(source, author, title, description, url, urlToImage, publishedAt) ⇒ NewsApiAttributes
Returns a new instance of NewsApiAttributes.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/news_api_attributes.rb', line 11 def initialize(source, , title, description, url, urlToImage, publishedAt) @id = source["id"] @name = source["name"] = @title = title @description = description @url = url @urlToImage = urlToImage @publishedAt = publishedAt end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
4 5 6 |
# File 'lib/news_api_attributes.rb', line 4 def end |
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/news_api_attributes.rb', line 6 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/news_api_attributes.rb', line 2 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/news_api_attributes.rb', line 3 def name @name end |
#publishedAt ⇒ Object
Returns the value of attribute publishedAt.
9 10 11 |
# File 'lib/news_api_attributes.rb', line 9 def publishedAt @publishedAt end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/news_api_attributes.rb', line 5 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
7 8 9 |
# File 'lib/news_api_attributes.rb', line 7 def url @url end |
#urlToImage ⇒ Object
Returns the value of attribute urlToImage.
8 9 10 |
# File 'lib/news_api_attributes.rb', line 8 def urlToImage @urlToImage end |