From: Giles Bowkett Date: 2006-11-25T04:47:50+09:00 Subject: Re: how do I contribute to Ruby? > Well, unlike a lot of languages, in Ruby you can modify all sorts of > built-ins. I don't personally believe that a case such as this > warrants it though, and often in Ruby it's better to use respond_to? > (duck typing) depending on the situation of course. > > class Array > def is_an?(klass) > return is_a?(klass) > end > end > > [].is_an? Array #=> true Just as an aside, to implement this, I would much rather monkeypatch Object than Array. Otherwise it just happens again the next time I have a class which begins with a vowel. -- Giles Bowkett http://www.gilesgoatboy.org