You are viewing a single comment's thread. Return to all comments →
def identify_class(obj) case obj when Hacker,Submission,TestCase,Contest puts "It's a #{obj.class}!" else puts "It's an unknown model" end end
this works incase someone is looking for different solutions.
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby Control Structures - Case (Bonus Question)
You are viewing a single comment's thread. Return to all comments →
this works incase someone is looking for different solutions.