You are viewing a single comment's thread. Return to all comments →
Why does this work?
case obj when Hacker, Submission, TestCase, Contest puts "It's a #{obj.class}!" else puts"It's an unknown model" end
When "k" == String it says false,
"k" === String is also false
what is the case logic in ruby?
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 →
Why does this work?
When "k" == String it says false,
"k" === String is also false
what is the case logic in ruby?