Class: Evri::Image
Overview
Represents an Image.
Defined Under Namespace
Classes: Thumbnail
Instance Attribute Summary collapse
-
#article_href ⇒ Object
Returns the value of attribute article_href.
-
#click_url ⇒ Object
Returns the value of attribute click_url.
-
#content ⇒ Object
Returns the value of attribute content.
-
#date ⇒ Object
Returns the value of attribute date.
-
#height ⇒ Object
Returns the value of attribute height.
-
#mime_type ⇒ Object
Returns the value of attribute mime_type.
-
#size ⇒ Object
Returns the value of attribute size.
-
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(json) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(json) ⇒ Image
Returns a new instance of Image.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/evri/media.rb', line 23 def initialize json @title = json["title"] @width = json["@width"] @height = json["@height"] @url = json["@url"] @size = json["size"] @title = json["title"] @article_href = json["articleHref"]["$"] @mime_type = json["mimeType"] @date = Date.parse(json["date"]["$"]) @content = json["content"]["$"] @click_url = json["clickUrl"]["$"] @thumbnail = Thumbnail.new(json["thumbnail"]) end |
Instance Attribute Details
#article_href ⇒ Object
Returns the value of attribute article_href.
22 23 24 |
# File 'lib/evri/media.rb', line 22 def article_href @article_href end |
#click_url ⇒ Object
Returns the value of attribute click_url.
22 23 24 |
# File 'lib/evri/media.rb', line 22 def click_url @click_url end |
#content ⇒ Object
Returns the value of attribute content.
22 23 24 |
# File 'lib/evri/media.rb', line 22 def content @content end |
#date ⇒ Object
Returns the value of attribute date.
22 23 24 |
# File 'lib/evri/media.rb', line 22 def date @date end |
#height ⇒ Object
Returns the value of attribute height.
22 23 24 |
# File 'lib/evri/media.rb', line 22 def height @height end |
#mime_type ⇒ Object
Returns the value of attribute mime_type.
22 23 24 |
# File 'lib/evri/media.rb', line 22 def mime_type @mime_type end |
#size ⇒ Object
Returns the value of attribute size.
22 23 24 |
# File 'lib/evri/media.rb', line 22 def size @size end |
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
22 23 24 |
# File 'lib/evri/media.rb', line 22 def thumbnail @thumbnail end |
#title ⇒ Object
Returns the value of attribute title.
22 23 24 |
# File 'lib/evri/media.rb', line 22 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
22 23 24 |
# File 'lib/evri/media.rb', line 22 def url @url end |
#width ⇒ Object
Returns the value of attribute width.
22 23 24 |
# File 'lib/evri/media.rb', line 22 def width @width end |