h.fulton / att.net writes:

> Greetings, fellow Ruby enthusiasts.
> 
> Perhaps I have a fundamental misunderstanding here.

Perhaps.. ;-)

When you defined Object.foobar, you're creating a singleton method in
Object (one that should be called as Object.foobar), not an instance
method. Thus the method is not available through a message to self.

So, you could rewrite it as an instance method, and all's fine. (I
also used the wonderful 'defined?' expression to check for foorbar in
a superclass.

class Object
  def foobar
    print "I am the ultimate foobar!\n"
  end
end

class Foo
  def foobar
    print "I am Foo::foobar... "
    if defined? super
      print "my parent has a foobar!\n"
      super
    else
      print "my parent does NOT have a foobar.\n"
    end
    print "My parent is ", self.type.superclass, "\n"
  end
end

Foo.new.foobar

-- 
Thomas Consulting.
Innovative and successful developments with Unix, Java, C, and C++. 

Now in bookstores:
 The Pragmatic Programmer.  www.pragmaticprogrammer.com/ppbook/