util.rb 542 B

12345678910111213141516171819202122
  1. ##
  2. ## $Release: 2.7.0 $
  3. ## copyright(c) 2006-2011 kuwata-lab.com all rights reserved.
  4. ##
  5. module Kernel
  6. ##
  7. ## raise NotImplementedError
  8. ##
  9. def not_implemented #:doc:
  10. backtrace = caller()
  11. method_name = (backtrace.shift =~ /`(\w+)'$/) && $1
  12. mesg = "class #{self.class.name} must implement abstract method '#{method_name}()'."
  13. #mesg = "#{self.class.name}##{method_name}() is not implemented."
  14. err = NotImplementedError.new mesg
  15. err.set_backtrace backtrace
  16. raise err
  17. end
  18. private :not_implemented
  19. end