Skip to content

Instantly share code, notes, and snippets.

@caius
Created June 18, 2009 11:24
Show Gist options
  • Save caius/131856 to your computer and use it in GitHub Desktop.
Save caius/131856 to your computer and use it in GitHub Desktop.
# ============
# = Take One =
# ============
module Something
# Setup some exceptions
class ZOMGError < Exception; end
class UserFail < Exception; end
class NeedMoarCowbell < Exception; end
end
# ============
# = Take Two =
# ============
module SomethingTwo
ZOMGError = Class.new(Exception)
UserFail = Class.new(Exception)
NeedMoarCowbell = Class.new(Exception)
end
# ==============
# = Take Three =
# ==============
module SomethingThree
%w(ZOMGError UserFail NeedMoarCowbell).each {|klass| const_set(klass, Class.new(Exception)) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment