Reflection API -- determining methods' origins

H

Hal E. Fulton

I've been thinking since yesterday about
#methods and #instance_methods and such.

I don't see any simple way of determining
whether a method is inherited or mixed in
or whatever. (Singleton methods can be
detected, I think.)

For example, suppose B inherits from A and
mixes in M.

I could do some array subtraction to take
away the methods from A and M... but that
ignores the possibility that they might be
rewritten in B.

What I'm trying for is a reliably way of
determining the methods that are *defined
in B* (regardless of whether they may be
hiding methods in a parent).

Am I overlooking something here?

Hal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top