class Dragonfly::ImageMagick::Generators::Plasma

Public Instance Methods

call(content, width, height, opts={}) click to toggle source
# File lib/dragonfly/image_magick/generators/plasma.rb, line 6
def call(content, width, height, opts={})
  format = extract_format(opts)
  content.generate!(:convert, "-size #{width}x#{height} plasma:fractal", format)
  content.add_meta('format' => format, 'name' => "plasma.#{format}")
end
update_url(url_attributes, width, height, opts={}) click to toggle source
# File lib/dragonfly/image_magick/generators/plasma.rb, line 12
def update_url(url_attributes, width, height, opts={})
  url_attributes.name = "plasma.#{extract_format(opts)}"
end

Private Instance Methods

extract_format(opts) click to toggle source
# File lib/dragonfly/image_magick/generators/plasma.rb, line 18
def extract_format(opts)
  opts['format'] || 'png'
end