Class: Imgur::Album

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Album

Returns a new instance of Album.



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/imgur.rb', line 190

def initialize(data)
  @id = data['id']
  @title = data['title']
  @description = data['description']
  @date = Time.at data['datetime']
  @cover = data['cover']
  @cover_width = data['cover_width']
  @account_url = data['account_url']
  @privacy = data['privacy']
  @layout = data['layout']
  @views = data['views']
  @link = data['link']
  @deletehash = data['deletehash']
  @images_count = data['images_count']
  @images = []
  data['images'].each do |img|
    @images << Image.new(img)
  end
end

Instance Attribute Details

#account_urlObject

Returns the value of attribute account_url.



181
182
183
# File 'lib/imgur.rb', line 181

def 
  @account_url
end

#coverObject

Returns the value of attribute cover.



178
179
180
# File 'lib/imgur.rb', line 178

def cover
  @cover
end

#cover_heightObject

Returns the value of attribute cover_height.



180
181
182
# File 'lib/imgur.rb', line 180

def cover_height
  @cover_height
end

#cover_widthObject

Returns the value of attribute cover_width.



179
180
181
# File 'lib/imgur.rb', line 179

def cover_width
  @cover_width
end

#dateObject

Returns the value of attribute date.



177
178
179
# File 'lib/imgur.rb', line 177

def date
  @date
end

#deletehashObject

Returns the value of attribute deletehash.



186
187
188
# File 'lib/imgur.rb', line 186

def deletehash
  @deletehash
end

#descriptionObject

Returns the value of attribute description.



176
177
178
# File 'lib/imgur.rb', line 176

def description
  @description
end

#idObject

Returns the value of attribute id.



174
175
176
# File 'lib/imgur.rb', line 174

def id
  @id
end

#imagesObject

Returns the value of attribute images.



188
189
190
# File 'lib/imgur.rb', line 188

def images
  @images
end

#images_countObject

Returns the value of attribute images_count.



187
188
189
# File 'lib/imgur.rb', line 187

def images_count
  @images_count
end

#layoutObject

Returns the value of attribute layout.



183
184
185
# File 'lib/imgur.rb', line 183

def layout
  @layout
end

Returns the value of attribute link.



185
186
187
# File 'lib/imgur.rb', line 185

def link
  @link
end

#privacyObject

Returns the value of attribute privacy.



182
183
184
# File 'lib/imgur.rb', line 182

def privacy
  @privacy
end

#titleObject

Returns the value of attribute title.



175
176
177
# File 'lib/imgur.rb', line 175

def title
  @title
end

#viewsObject

Returns the value of attribute views.



184
185
186
# File 'lib/imgur.rb', line 184

def views
  @views
end