Skip to content

Instantly share code, notes, and snippets.

@shime
Created April 8, 2012 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shime/2339314 to your computer and use it in GitHub Desktop.
Save shime/2339314 to your computer and use it in GitHub Desktop.
defining a lot of exceptions in a module
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