i math|




How A Ruby Case Statement Works And What You Can Do With It

I found case statements in Ruby pretty interesting as they are capable of doing a little more than the equivalent constructs in other languages. We all know how a simple case statement works, we test on a condition that we give to a case statement, we then walk through a set of possible matches each of which is contained in a when statement e.g.: ruby print "Enter your grade: " grade = gets.