From: Joe Van Dyk Date: 2005-09-24T13:35:08+09:00 Subject: Re: class methods On 9/22/05, Mark Volkmann wrote: > On 9/22/05, Trans wrote: > > Class is an Object too, so > > > > MyClass.methods.sort.each {|m| puts m} > > The method "methods" returns ALL the methods. > I want just the class methods, those I can invoke without creating an > object from the class. > For example, querying the class Thread should give me "current", but > not "alive?". Didn't you see my post? class Foo def self.class_method_foo end def public_method_foo end end Foo.methods.include? "class_method_foo" => true Foo.methods.include? "public_method_foo" => false Also, Mac-Mini:~ joevandyk$ irb irb(main):001:0> Thread.methods.include? "alive?" => false irb(main):002:0> Thread.methods.include? "current" => true