P
Peter Morris
Folks, would there be any DOWNSIDE to the call to the parents INHERITED
method being deferred from the start to the end of the definition of
the subclass?
At the moment if you...
class A
def self.inherited klass
end
end
class B < A # this is point (1)
def self.some_method
end
end # this is point (2)
at point (1), the inherited call on A happens.
Now, what I want to know is.... would there be a problem if this was
deferred to point(2)
if you DID do that, then you could do interesting things inside inherited...
class A
def self.inherited klass
do_something_interesting if klass.respond_to?some_method)
end
end
Just a thought.
method being deferred from the start to the end of the definition of
the subclass?
At the moment if you...
class A
def self.inherited klass
end
end
class B < A # this is point (1)
def self.some_method
end
end # this is point (2)
at point (1), the inherited call on A happens.
Now, what I want to know is.... would there be a problem if this was
deferred to point(2)
if you DID do that, then you could do interesting things inside inherited...
class A
def self.inherited klass
do_something_interesting if klass.respond_to?some_method)
end
end
Just a thought.