Class: Imgur::LocalImage

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

Overview

Represents an image stored on the computer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, options = {}) ⇒ LocalImage

Returns a new instance of LocalImage.



221
222
223
224
225
226
227
228
229
230
# File 'lib/imgur.rb', line 221

def initialize(file, options={})
  if file.is_a? String
    @file = File.open file, 'rb'
  else
    @file = file
  end
  @title = options[:title]
  @description = options[:description]
  @album_id = options[:album_id]
end

Instance Attribute Details

#album_idObject

Returns the value of attribute album_id.



219
220
221
# File 'lib/imgur.rb', line 219

def album_id
  @album_id
end

#descriptionObject

Returns the value of attribute description.



219
220
221
# File 'lib/imgur.rb', line 219

def description
  @description
end

#fileObject

Returns the value of attribute file.



219
220
221
# File 'lib/imgur.rb', line 219

def file
  @file
end

#titleObject

Returns the value of attribute title.



219
220
221
# File 'lib/imgur.rb', line 219

def title
  @title
end