Created
April 8, 2012 19:08
-
-
Save shime/2339314 to your computer and use it in GitHub Desktop.
defining a lot of exceptions in a module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Prawn | |
module Errors | |
exceptions = %w[ FailedObjectConversion InvalidPageLayout NotOnPage | |
UnknownFont IncompatibleStringEncoding UnknownOption ] | |
exceptions.each { |e| const_set(e, Class.new(StandardError)) } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment