Class: Evri::Article
Overview
Represents an Article.
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#content ⇒ Object
Returns the value of attribute content.
-
#href ⇒ Object
Returns the value of attribute href.
-
#published_at ⇒ Object
Returns the value of attribute published_at.
-
#title ⇒ Object
Returns the value of attribute title.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(json) ⇒ Article
constructor
:nodoc:.
Constructor Details
#initialize(json) ⇒ Article
:nodoc:
10 11 12 13 14 15 16 17 |
# File 'lib/evri/media.rb', line 10 def initialize json # :nodoc: @title = json[:title] @author = json[:author] @content = (json[:content] || "No content provided") @published_at = json[:published] @href = Evri.api_host + json[:link][:href] @uri = json[:link][:hostName] + json[:link][:path] end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
9 10 11 |
# File 'lib/evri/media.rb', line 9 def @author end |
#content ⇒ Object
Returns the value of attribute content.
9 10 11 |
# File 'lib/evri/media.rb', line 9 def content @content end |
#href ⇒ Object
Returns the value of attribute href.
9 10 11 |
# File 'lib/evri/media.rb', line 9 def href @href end |
#published_at ⇒ Object
Returns the value of attribute published_at.
9 10 11 |
# File 'lib/evri/media.rb', line 9 def published_at @published_at end |
#title ⇒ Object
Returns the value of attribute title.
9 10 11 |
# File 'lib/evri/media.rb', line 9 def title @title end |
#uri ⇒ Object
Returns the value of attribute uri.
9 10 11 |
# File 'lib/evri/media.rb', line 9 def uri @uri end |