Re: Enforce implementation of Module method
- From: Gareth Adams <gareth.adams@xxxxxxxxx>
- Date: Fri, 14 Dec 2007 09:58:39 -0500
Phrogz <phrogz <at> 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.
.
- Follow-Ups:
- Re: Enforce implementation of Module method
- From: Rob Biedenharn
- Re: Enforce implementation of Module method
- References:
- Enforce implementation of Module method
- From: Paul
- Re: Enforce implementation of Module method
- From: Phrogz
- Enforce implementation of Module method
- Prev by Date: Re: Is there any way to redefine the `new' method?
- Next by Date: Re: [QUIZ] Programmer Ping-Pong (#150)
- Previous by thread: Re: Enforce implementation of Module method
- Next by thread: Re: Enforce implementation of Module method
- Index(es):
Relevant Pages
|
Loading