KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
What is the best way to use a class object in case statement? Suppose I have a which is an instance of the Class class. I want to match it against different classes. If I do case a when String then ... when Fixnum then ... end this will not give the intended result because even if a == String for example, a === String is not true. What is the clever way to do this?
Tags (comma-separated)
Save Edits
Cancel