Reflection API -- determining methods' origins

Discussion in 'Ruby' started by Hal E. Fulton, Aug 8, 2003.

  1. 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

    --
    Hal Fulton
     
    Hal E. Fulton, Aug 8, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Serge
    Replies:
    7
    Views:
    1,260
    Adam Jenkins
    Feb 17, 2004
  2. Nick Landsberg

    [OT] Origins of a.out

    Nick Landsberg, Feb 16, 2004, in forum: C Programming
    Replies:
    6
    Views:
    347
    Dave Thompson
    Feb 23, 2004
  3. Claire McLister

    [OT] Map of email origins to Python list

    Claire McLister, Nov 7, 2005, in forum: Python
    Replies:
    23
    Views:
    645
    Tom Anderson
    Nov 9, 2005
  4. Mik Houghton

    Ruby origins

    Mik Houghton, Nov 1, 2006, in forum: Ruby
    Replies:
    3
    Views:
    85
    Mik Houghton
    Nov 4, 2006
  5. Kenneth McDonald
    Replies:
    5
    Views:
    353
    Kenneth McDonald
    Sep 26, 2008
Loading...

Share This Page