------art_79733_17614011.1168919101937
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

do you know of anyway to do this on an instance of an object, not on the
class method??

thanks..



On 1/15/07, aaron smith <beingthexemplarylists / gmail.com> wrote:
>
> yes, is_a? does report inheritance. consider this...
>
> class C
> end
>
> class D < C
> end
>
> t  .new
>
> puts t.is_a?(C)
>
> thanks.
>
>
> On 1/15/07, dblack / wobblini.net <dblack / wobblini.net> wrote:
> >
> > Hi --
> >
> > On Tue, 16 Jan 2007, Aaron Smith wrote:
> >
> > > How can I find out what the super class is of an object, Say if a
> > class
> > > extends Hash. I need to be able to find a string representation of the
> > > super class ('Hash').... is_a? won't work as that requires an actual
> > > module or class..
> >
> > is_a? won't report an inheritance relationship in any case:
> >
> >    class D < C; end
> >    D.is_a?(C)  # false (unless C is Object maybe....)
> >
> > > I need a string representation.
> > >
> > > any ideas? thanks..
> >
> > superclass.name will give it to you as a string.
> >
> >
> > David
> >
> > --
> > Q. What is THE Ruby book for Rails developers?
> > A. RUBY FOR RAILS by David A. Black ( http://www.manning.com/black)
> >     (See what readers are saying!  http://www.rubypal.com/r4rrevs.pdf)
> > Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
> > A. Ruby Power and Light, LLC (http://www.rubypal.com)
> >
> >
>

------art_79733_17614011.1168919101937--