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.



218
219
220
221
222
223
224
225
226
227
# File 'lib/imgur.rb', line 218

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.



216
217
218
# File 'lib/imgur.rb', line 216

def album_id
  @album_id
end

#descriptionObject

Returns the value of attribute description.



215
216
217
# File 'lib/imgur.rb', line 215

def description
  @description
end

#fileObject

Returns the value of attribute file.



213
214
215
# File 'lib/imgur.rb', line 213

def file
  @file
end

#titleObject

Returns the value of attribute title.



214
215
216
# File 'lib/imgur.rb', line 214

def title
  @title
end