Also:

puts RUBY_VERSION  #=>1.8.6

puts self       #=>main
puts self.class #=>Object

def hello
end

puts Object.private_instance_methods.grep(/^h/) #=>hello

puts self.public_methods.include?("hello")
#=>false

#puts self.singleton_class.instance_methods.include?(:hello)

-- 
Posted via http://www.ruby-forum.com/.