From: benjohn@... Date: 2006-03-15T00:45:47+09:00 Subject: Re: abstract method in Ruby > I've been following the discussion on abstract method declaration with > some interest. It seems to me that the ideal implementation should not > only throw an exception on unimplemented methods, but also must pass > Matz's example (implementation provided by base classes) and the > method_missing example. :) I like your approach, and I think it's extremely close. I'd change one of your tests a little though: > # Here we make sure that not implementing the abstract method in the > # child class will cause an exception when the method is invoked on > # the child object. We don't particularly care what exception is > # thrown, but the exception message must mention the missing method > # by name. > def test_unimplemented_abstract_method_throws_exception ... It would be preferable I think, if a more helpful error message were given, instead of simply the method being missing. And while I suspect you're being a little flipant, I like your implementation - it does do nearly everything that's desired.