I've seeing some unexpected behavior for Module#public_instance_methods in 1.8.

    class Foo
      def hello
        :regular_instance_method
      end
    end

    def singleton_class_for(obj)
      class << obj; self; end
    end

    # public_instance_methods(false) is supposed to give a list of
methods defined
    # on the Class or Module, *not including ancestors*

    # I expect these values:
    # On 1.9.2, 1.9.3: [:hello]
    # On 1.8.7: ["hello"]
    p Foo.public_instance_methods(false)

    # On 1.9.2, 1.9.3: []
    # On 1.8.7: ["hello"] <-- WHY? I DID NOT EXPECT THIS
    p singleton_class_for(Foo.new).public_instance_methods(false)

1) Is this a bug?
2) Either way, is there any way to check in 1.8 if a method is defined
exactly on a given class, not on one of its ancestors?

Thanks!

-- 
Andy Lindeman
http://www.andylindeman.com/