It’s nice to have case and when available in Ruby. But I don’t see it used too often. I myself don’t use it much because I’m more accustomed to just using if and else. So let’s get into case switching.
person = "employee"
puts "Yes sir!"
puts "Sure I'll get around to that if I have any time."
puts "*smile and nod*"
# => "Sure I'll get around to that if I have any time."
This is your standard use of case switching. We check whatever variable is handed…
Continue Reading »