Ruby class types and case statements November 14, 2022 by Tarik You must use: case item when MyClass ... I had the same problem: How to catch Errno::ECONNRESET class in “case when”?