Method: Twimage::Image#initialize

Defined in:
lib/twimage/image.rb

#initialize(options) ⇒ Image

Returns a new instance of Image.



6
7
8
9
10
11
12
13
14
# File 'lib/twimage/image.rb', line 6

def initialize(options)
  @service      = options[:service]
  @service_url  = options[:service_url]
  @image_url    = options[:image_url]
  
  extension = @image_url.match(/(\.\w+)(\?|$)/)[1]
  @tempfile = Tempfile.new(['twimage', extension])
  @tempfile << options[:image]
end