Exception: Alchemy::WrongImageFormatError
- Inherits:
-
StandardError
- Object
- StandardError
- Alchemy::WrongImageFormatError
- Defined in:
- lib/alchemy/errors.rb
Overview
Raised if calling image_file
on a Picture object returns nil.
Instance Method Summary collapse
-
#initialize(image, requested_format) ⇒ WrongImageFormatError
constructor
A new instance of WrongImageFormatError.
- #message ⇒ Object
Constructor Details
#initialize(image, requested_format) ⇒ WrongImageFormatError
Returns a new instance of WrongImageFormatError.
38 39 40 41 |
# File 'lib/alchemy/errors.rb', line 38 def initialize(image, requested_format) @image = image @requested_format = requested_format end |
Instance Method Details
#message ⇒ Object
43 44 45 46 |
# File 'lib/alchemy/errors.rb', line 43 def 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 |