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.
56 57 58 59 |
# File 'lib/alchemy/errors.rb', line 56 def initialize(image, requested_format) @image = image @requested_format = requested_format end |
Instance Method Details
#message ⇒ Object
61 62 63 64 |
# File 'lib/alchemy/errors.rb', line 61 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 |