Class: Imgur::Image
- Inherits:
-
Object
- Object
- Imgur::Image
- Defined in:
- lib/imgur.rb
Overview
Represents an image on Imgur
Instance Attribute Summary collapse
-
#animated ⇒ Object
Returns the value of attribute animated.
-
#bandwidth ⇒ Object
Returns the value of attribute bandwidth.
-
#date ⇒ Object
Returns the value of attribute date.
-
#deletehash ⇒ Object
Returns the value of attribute deletehash.
-
#description ⇒ Object
Returns the value of attribute description.
-
#favorite ⇒ Object
Returns the value of attribute favorite.
-
#height ⇒ Object
Returns the value of attribute height.
-
#html_link ⇒ Object
Returns the value of attribute html_link.
-
#id ⇒ Object
Returns the value of attribute id.
-
#link ⇒ Object
Returns the value of attribute link.
-
#nsfw ⇒ Object
Returns the value of attribute nsfw.
-
#section ⇒ Object
Returns the value of attribute section.
-
#size ⇒ Object
Returns the value of attribute size.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#views ⇒ Object
Returns the value of attribute views.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(data) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(data) ⇒ Image
Returns a new instance of Image.
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/imgur.rb', line 240 def initialize(data) @id = data['id'] @title = data['title'] @description = data['description'] @date = Time.at data['datetime'] @type = data['type'] @animated = data['animated'] @width = data['width'] @height = data['height'] @size = data['size'] @views = data['views'] @bandwidth = data['bandwidth'] @favorite = data['favorite'] @nsfw = data['nsfw'] @section = data['section'] @deletehash = data['deletehash'] @link = data['link'] @html_link = HTML_PATH + @id end |
Instance Attribute Details
#animated ⇒ Object
Returns the value of attribute animated.
236 237 238 |
# File 'lib/imgur.rb', line 236 def animated @animated end |
#bandwidth ⇒ Object
Returns the value of attribute bandwidth.
236 237 238 |
# File 'lib/imgur.rb', line 236 def bandwidth @bandwidth end |
#date ⇒ Object
Returns the value of attribute date.
236 237 238 |
# File 'lib/imgur.rb', line 236 def date @date end |
#deletehash ⇒ Object
Returns the value of attribute deletehash.
236 237 238 |
# File 'lib/imgur.rb', line 236 def deletehash @deletehash end |
#description ⇒ Object
Returns the value of attribute description.
236 237 238 |
# File 'lib/imgur.rb', line 236 def description @description end |
#favorite ⇒ Object
Returns the value of attribute favorite.
236 237 238 |
# File 'lib/imgur.rb', line 236 def favorite @favorite end |
#height ⇒ Object
Returns the value of attribute height.
236 237 238 |
# File 'lib/imgur.rb', line 236 def height @height end |
#html_link ⇒ Object
Returns the value of attribute html_link.
236 237 238 |
# File 'lib/imgur.rb', line 236 def html_link @html_link end |
#id ⇒ Object
Returns the value of attribute id.
236 237 238 |
# File 'lib/imgur.rb', line 236 def id @id end |
#link ⇒ Object
Returns the value of attribute link.
236 237 238 |
# File 'lib/imgur.rb', line 236 def link @link end |
#nsfw ⇒ Object
Returns the value of attribute nsfw.
236 237 238 |
# File 'lib/imgur.rb', line 236 def nsfw @nsfw end |
#section ⇒ Object
Returns the value of attribute section.
236 237 238 |
# File 'lib/imgur.rb', line 236 def section @section end |
#size ⇒ Object
Returns the value of attribute size.
236 237 238 |
# File 'lib/imgur.rb', line 236 def size @size end |
#title ⇒ Object
Returns the value of attribute title.
236 237 238 |
# File 'lib/imgur.rb', line 236 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
236 237 238 |
# File 'lib/imgur.rb', line 236 def type @type end |
#views ⇒ Object
Returns the value of attribute views.
236 237 238 |
# File 'lib/imgur.rb', line 236 def views @views end |
#width ⇒ Object
Returns the value of attribute width.
236 237 238 |
# File 'lib/imgur.rb', line 236 def width @width end |