EL Fri, 26 Jan 2007 03:16:39 +0900
Yukihiro Matsumoto <firstname.lastname@example.org> escrigué:
>> public. I don't recommend to override protected method though.
Because protected methods are called only from subclass of defining
class. That means overriding changes the restriction scope of the
>You might have a protected method in a module which has no code or
>only an exception (something like an abstract method in Java/C#) and
has |a different behaviour in the different classes which include it.
In this |case it must have been overriden.
>What do you think about this?
As far as current protected behavior remains, I'd recommend to prepare
separate method to override in the subclass.
Excuse me if I'm getting boring but I don't know if I explained myself
well, here is an example:
#raise a not implemented method.
I know that it could be written, for example, as a attr_reader and set
it in the initialize, but this is the idea I want to express (I think
its so useful).
Or maybe you want to say that it's better to code an intermidiate class
between de module and the classes (or even instead of the module) and
declare there the "abstract" method?
Sorry, but I'm so used to Java and C#.
In message "Re: Class & modifiers modifiers" > on Fri, 26 Jan 2007 01:13:25 +0900, Miquel <email@example.com> > writes:
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.