class ActiveLdap::LdapError

def define(code, name, target)

def define(code, name, target)
  klass_name = name.downcase.camelize
  target.module_eval(<<-EOC, __FILE__, __LINE__ + 1)
    class #{klass_name} < #{self}
      CODE = #{code}
      def code
        CODE
      end
    end
  target.const_get(klass_name)
end