class Alchemy::WrongImageFormatError

Raised if calling image_file on a Picture object returns nil.

Public Class Methods

new(image, requested_format) click to toggle source
# File lib/alchemy/errors.rb, line 38
def initialize(image, requested_format)
  @image = image
  @requested_format = requested_format
end

Public Instance Methods

message() click to toggle source
# File lib/alchemy/errors.rb, line 43
def message
  allowed_filetypes = Alchemy::Picture.allowed_filetypes.map(&:upcase).to_sentence
  "Requested image format (#{@requested_format.inspect}) for #{@image.inspect} is not one of allowed filetypes (#{allowed_filetypes})."
end