=== with class type equality check fails

Földes László wrote in post #1052241:

based on documentation, '===' should be smarter than '=='.
Did I miss something here?

Yes - read the documentation again.

In the case of a Class object, the === operator means "is an instance
of". So you should write:

case variable # not variable.class
when Fixnum
   ...
when String
   ...
end

HTH,

Brian.

···

--
Posted via http://www.ruby-forum.com/\.