Class: Ungulate::RmagickVersionCreator

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ RmagickVersionCreator

Returns a new instance of RmagickVersionCreator.



7
8
9
10
# File 'lib/ungulate/rmagick_version_creator.rb', line 7

def initialize(options = {})
  @logger = options[:logger] || ::Logger.new($stdout)
  @http = options[:http]
end

Instance Method Details

#create(blob, instructions) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/ungulate/rmagick_version_creator.rb', line 12

def create(blob, instructions)
  image = processed_image(magick_image_from_blob(blob), instructions)
  {
    :blob => image.to_blob,
    :content_type => MIME::Types.type_for(image.format).to_s
  }
end