Class: Evri::Article

Inherits:
Media
  • Object
show all
Defined in:
lib/evri/media.rb

Overview

Represents an Article.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#authorObject

Returns the value of attribute author.



9
10
11
# File 'lib/evri/media.rb', line 9

def author
  @author
end

#contentObject

Returns the value of attribute content.



9
10
11
# File 'lib/evri/media.rb', line 9

def content
  @content
end

#hrefObject

Returns the value of attribute href.



9
10
11
# File 'lib/evri/media.rb', line 9

def href
  @href
end

#published_atObject

Returns the value of attribute published_at.



9
10
11
# File 'lib/evri/media.rb', line 9

def published_at
  @published_at
end

#titleObject

Returns the value of attribute title.



9
10
11
# File 'lib/evri/media.rb', line 9

def title
  @title
end

#uriObject

Returns the value of attribute uri.



9
10
11
# File 'lib/evri/media.rb', line 9

def uri
  @uri
end