2009-07-05 01:26:55 +10:00
|
|
|
begin
|
2011-12-17 08:23:59 +11:00
|
|
|
require 'rubygems' unless defined? Gem
|
2010-11-22 14:53:06 +11:00
|
|
|
require 'irbtools'
|
2009-07-05 01:26:55 +10:00
|
|
|
rescue LoadError
|
2010-11-22 14:53:06 +11:00
|
|
|
$stderr.puts "Please install 'irbtools' or add it to your Gemfile"
|
2009-07-05 01:26:55 +10:00
|
|
|
end
|
2008-11-19 14:54:10 +11:00
|
|
|
|
2008-10-09 12:51:52 +11:00
|
|
|
class Object
|
|
|
|
# Return a list of methods defined locally for a particular object. Useful
|
|
|
|
# for seeing what it does whilst losing all the guff that's implemented
|
|
|
|
# by its parents (eg Object).
|
|
|
|
def local_methods(obj = self)
|
|
|
|
(obj.methods - obj.class.superclass.instance_methods).sort
|
|
|
|
end
|
2009-06-10 13:02:44 +10:00
|
|
|
end
|