Last Updated: February 25, 2016
·
350
· mejarc

Ruby case, a.k.a switch

Note the indentation. Lack of it seems to be known as Pickaxe styling, and the GitHub styleguide favors this as well.

case "foo"
when "bar" then 1
when "baz" then 2
else 3
end