Method: DefineException::ClassMethods#define_exception

Defined in:
lib/define_exception.rb

#define_exception(exception, default_message = 'Application Error Occurred', ancestor = 'RuntimeError') ⇒ Object



73
74
75
76
77
78
79
80
81
# File 'lib/define_exception.rb', line 73

def define_exception( exception, default_message = 'Application Error Occurred', ancestor = 'RuntimeError' )
  class_eval <<-EOD
    class #{exception.to_s.lame_camel_case} < #{ancestor.to_s.lame_camel_case}
      def initialize( message = nil )
        super( message || "#{default_message}" )
      end
    end
  EOD
end