Right, that's exactly what I meant, and that's in fact the work around
which I've been using.
My question is really why I need to do this, and if there is a better
way... It forces me to decide whether I'll ever subclass when I code
the parent, which seems unrubyish... I'd rather just code the parent,
and if the child changes the URL, so be it!
and that is exactly why you should not use a Constant.
Constants do not change, do they ;)?
You should use an instance variable and define accessor methods to it. (or
class variable for that matter)
These accessor methods are then used by the superclass.
This is a classic pattern, but I do not know its name in English, sorry.
Hope this helps
Robert
···
On 3/27/06, listrecv@gmail.com <listrecv@gmail.com> wrote:
the parent, which seems unrubyish... I'd rather just code the parent,
and if the child changes the URL, so be it!
--
Deux choses sont infinies : l'univers et la bêtise humaine ; en ce qui
concerne l'univers, je n'en ai pas acquis la certitude absolue.
@@class_variables seemed to have the same behavior - if they were
changed in the subclass, and the parent defined a method, it wouldn't
have access to the subclass's definition.
(BTW - of course Constants don't change - but different subclasses
could have different ones - with them never changing - but I digress)
No do not worry you do not, I just looked at an implementation that might
fit your needs better, the conceptual discussion remains interesting anyhow.
I will check out the class variable behaviour you mentioned, I was surprised
about it.
Cheers
Robert
···
On 3/28/06, listrecv@gmail.com <listrecv@gmail.com> wrote:
@@class_variables seemed to have the same behavior - if they were
changed in the subclass, and the parent defined a method, it wouldn't
have access to the subclass's definition.
(BTW - of course Constants don't change - but different subclasses
could have different ones - with them never changing - but I digress)
--
Deux choses sont infinies : l'univers et la bêtise humaine ; en ce qui
concerne l'univers, je n'en ai pas acquis la certitude absolue.