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
Time object of :datetime.
-
#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.
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/imgur.rb', line 256 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.
243 244 245 |
# File 'lib/imgur.rb', line 243 def animated @animated end |
#bandwidth ⇒ Object
Returns the value of attribute bandwidth.
248 249 250 |
# File 'lib/imgur.rb', line 248 def bandwidth @bandwidth end |
#date ⇒ Object
Time object of :datetime
241 242 243 |
# File 'lib/imgur.rb', line 241 def date @date end |
#deletehash ⇒ Object
Returns the value of attribute deletehash.
252 253 254 |
# File 'lib/imgur.rb', line 252 def deletehash @deletehash end |
#description ⇒ Object
Returns the value of attribute description.
240 241 242 |
# File 'lib/imgur.rb', line 240 def description @description end |
#favorite ⇒ Object
Returns the value of attribute favorite.
249 250 251 |
# File 'lib/imgur.rb', line 249 def favorite @favorite end |
#height ⇒ Object
Returns the value of attribute height.
245 246 247 |
# File 'lib/imgur.rb', line 245 def height @height end |
#html_link ⇒ Object
Returns the value of attribute html_link.
254 255 256 |
# File 'lib/imgur.rb', line 254 def html_link @html_link end |
#id ⇒ Object
Returns the value of attribute id.
238 239 240 |
# File 'lib/imgur.rb', line 238 def id @id end |
#link ⇒ Object
Returns the value of attribute link.
253 254 255 |
# File 'lib/imgur.rb', line 253 def link @link end |
#nsfw ⇒ Object
Returns the value of attribute nsfw.
250 251 252 |
# File 'lib/imgur.rb', line 250 def nsfw @nsfw end |
#section ⇒ Object
Returns the value of attribute section.
251 252 253 |
# File 'lib/imgur.rb', line 251 def section @section end |
#size ⇒ Object
Returns the value of attribute size.
246 247 248 |
# File 'lib/imgur.rb', line 246 def size @size end |
#title ⇒ Object
Returns the value of attribute title.
239 240 241 |
# File 'lib/imgur.rb', line 239 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
242 243 244 |
# File 'lib/imgur.rb', line 242 def type @type end |
#views ⇒ Object
Returns the value of attribute views.
247 248 249 |
# File 'lib/imgur.rb', line 247 def views @views end |
#width ⇒ Object
Returns the value of attribute width.
244 245 246 |
# File 'lib/imgur.rb', line 244 def width @width end |