Class: Dragonfly::ImageMagick::Generators::Plain
- Defined in:
- lib/dragonfly/image_magick/generators/plain.rb
Instance Method Summary collapse
- #call(content, width, height, opts = {}) ⇒ Object
- #update_url(url_attributes, width, height, opts = {}) ⇒ Object
Instance Method Details
#call(content, width, height, opts = {}) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/dragonfly/image_magick/generators/plain.rb', line 6 def call(content, width, height, opts={}) format = extract_format(opts) colour = opts['colour'] || opts['color'] || 'white' content.generate!(:convert, "-size #{width}x#{height} xc:#{colour}", format) content.('format' => format, 'name' => "plain.#{format}") end |
#update_url(url_attributes, width, height, opts = {}) ⇒ Object
13 14 15 |
# File 'lib/dragonfly/image_magick/generators/plain.rb', line 13 def update_url(url_attributes, width, height, opts={}) url_attributes.name = "plain.#{extract_format(opts)}" end |