Module: DefineException::ClassMethods

Defined in:
lib/define_exception.rb

Instance Method Summary collapse

Instance Method Details

#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 "    class \#{exception.to_s.lame_camel_case} < \#{ancestor.to_s.lame_camel_case}\n      def initialize( message = nil )\n        super( message || \"\#{default_message}\" )\n      end\n    end\n  EOD\nend\n"