Class: Imgur::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/imgur.rb

Overview

Represents an image on Imgur

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#animatedObject

Returns the value of attribute animated.



236
237
238
# File 'lib/imgur.rb', line 236

def animated
  @animated
end

#bandwidthObject

Returns the value of attribute bandwidth.



236
237
238
# File 'lib/imgur.rb', line 236

def bandwidth
  @bandwidth
end

#dateObject

Returns the value of attribute date.



236
237
238
# File 'lib/imgur.rb', line 236

def date
  @date
end

#deletehashObject

Returns the value of attribute deletehash.



236
237
238
# File 'lib/imgur.rb', line 236

def deletehash
  @deletehash
end

#descriptionObject

Returns the value of attribute description.



236
237
238
# File 'lib/imgur.rb', line 236

def description
  @description
end

#favoriteObject

Returns the value of attribute favorite.



236
237
238
# File 'lib/imgur.rb', line 236

def favorite
  @favorite
end

#heightObject

Returns the value of attribute height.



236
237
238
# File 'lib/imgur.rb', line 236

def height
  @height
end

Returns the value of attribute html_link.



236
237
238
# File 'lib/imgur.rb', line 236

def html_link
  @html_link
end

#idObject

Returns the value of attribute id.



236
237
238
# File 'lib/imgur.rb', line 236

def id
  @id
end

Returns the value of attribute link.



236
237
238
# File 'lib/imgur.rb', line 236

def link
  @link
end

#nsfwObject

Returns the value of attribute nsfw.



236
237
238
# File 'lib/imgur.rb', line 236

def nsfw
  @nsfw
end

#sectionObject

Returns the value of attribute section.



236
237
238
# File 'lib/imgur.rb', line 236

def section
  @section
end

#sizeObject

Returns the value of attribute size.



236
237
238
# File 'lib/imgur.rb', line 236

def size
  @size
end

#titleObject

Returns the value of attribute title.



236
237
238
# File 'lib/imgur.rb', line 236

def title
  @title
end

#typeObject

Returns the value of attribute type.



236
237
238
# File 'lib/imgur.rb', line 236

def type
  @type
end

#viewsObject

Returns the value of attribute views.



236
237
238
# File 'lib/imgur.rb', line 236

def views
  @views
end

#widthObject

Returns the value of attribute width.



236
237
238
# File 'lib/imgur.rb', line 236

def width
  @width
end