From: Rob Biedenharn Date: 2007-12-15T00:18:52+09:00 Subject: Re: Enforce implementation of Module method On Dec 14, 2007, at 9:58 AM, Gareth Adams wrote: > Phrogz mac.com> writes: >> module Parenting >> def children >> raise "OOPS!" #Better error message here >> end >> end >> >> If a class defines that method, it will shadow the module method. As >> long as the class method doesn't try to call super, you should be >> good >> to go. > > And of course, there's a rather handy NotImplementedError class just > sat there > in Ruby code if you want to use it. If you simply don't define Parenting#children, you'll get a NoMethodError. Isn't that good enough? -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com