M
matt neuburg
Howdy. I am a class. There are certain rules for what you are supposed
to do when you subclass me, so as a sanity check I wish to introspect
your subclass to make sure it's obeying the contract.
However, my problem is that self.inherited is called too early.
class C # this is me
def self.inherited(p)
#whatever
super
end
end
class B < C # this is you
# C's self.inherited is called right here
def yourFirstMethod
# etc.
end
end
So I can't, in my self.inherited, ask about what methods you have
defined, because you haven't defined them yet. This must have come up
before; is there an easy solution? Thx - m.
to do when you subclass me, so as a sanity check I wish to introspect
your subclass to make sure it's obeying the contract.
However, my problem is that self.inherited is called too early.
class C # this is me
def self.inherited(p)
#whatever
super
end
end
class B < C # this is you
# C's self.inherited is called right here
def yourFirstMethod
# etc.
end
end
So I can't, in my self.inherited, ask about what methods you have
defined, because you haven't defined them yet. This must have come up
before; is there an easy solution? Thx - m.