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
Written by Melanie Archer
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Related Tags
#ruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#