From: Duane Johnson Date: 2006-05-12T08:43:54+09:00 Subject: Re: Newb question - object type tests? On May 11, 2006, at 5:32 PM, Adam Bloom wrote: > Hello all, > > I feel like I definitely should know this, but how do you test the > type > of an object? For example: > > item = ["hello"] > item.array? >> true item.is_a? Array => true item.class => Array > item = "hello" > item.array? >> false item.is_a? Array => false item.class => String > > extending that, how do I test the type of a class that I made? > It's built in to all classes (that derive from the Object class, and all classes do). Duane Johnson (canadaduane)