From: itsme213 Date: 2005-12-15T02:57:39+09:00 Subject: Re: #methods and #public_instance_methods String.instance_methods == "abc".methods String.instance_methods gives methods on instances of String. String.methods gives methods on String itself. Hth. "Jeff Cohen" wrote in message news:bcd0453943d7bed44939379f19791061@ruby-forum.com... > I'm trying to understand #methods and #public_instance_methods as I > learn about introspection in Ruby. > > If I do String.methods in irb, I get a lot fewer listed than if I try > String.public_instance_methods. I would have guessed that > String.public_instance_methods would be a subset of String.methods. > > Also, ri String.public_instance_methods has no information, and > public_instance_methods is not listed on ruby-doc.org/core. I only > found it by doing a String.methods. > > Can anyone shed some light here? > > Thanks > Jeff > > -- > Posted via http://www.ruby-forum.com/. > >