From: Brian Candler Date: 2009-02-09T22:24:51+09:00 Subject: Re: Module#=== vs Object#is_a? Peter Fitzgibbons wrote: > HI All, > > Could somone explain the subtle difference between Module#=== and > Object#is_a? > > I found a usage of === to test if an argument is Regexp or not... just > want > to know the restrictions. > The code is beautiful... > > if Regexp === regexp_or_string case regexp_or_string when Regexp .. do something when String .. do something else else raise "Not a regexp or string" end This is the same thing though: case x when y .. does a "y === x" test under the hood. -- Posted via http://www.ruby-forum.com/.