On Thu, 1 Aug 2002, J.Hawkesworth wrote:

> While I'm typing I'd just like to say how much I like the ability to run
> up irb, type in:
>
> require 'net/ftp'
> ftp = Net::FTP::new('anftpserver')
> ftp.methods

Even better: replace two last lines with:

puts (Net::FTP.methods - Object.methods).sort,
"---", (Net::FTP.instance_methods - Object.instance_methods).sort

Slightly longer, but it gives you

1) List of class methods not shared with Object
2) List of instance methods not shared with Object

Actually, that in my .irbrc I have:

$ cat .irbrc
def help(obj)
   if obj.class == Class
      if obj != Object
         c_list = (obj.methods - Object.methods).sort
         i_list = (obj.instance_methods - Object.instance_methods).sort
      else
         c_list = obj.methods.sort
         i_list = obj.instance_methods
      end
      a_list = obj.ancestors
   else
      c_list = (obj.class.methods - Object.methods).sort
      i_list = (obj.class.instance_methods - Object.instance_methods).sort
      a_list = obj.class.ancestors
   end
   puts "="*50, "Class Methods", "="*50, c_list,
        "="*50, "Instance Methods", "="*50, i_list,
        "="*50, "Ancestors", "="*50, a_list
end



I really should clean that up, but it does what it is supposed to.

 -- Nikodemus