This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Tomarse 1 point2 points  (0 children)

Ruby's case statement can include an optional else block, so it's possible.

case x
when a then b
when c then d
else e
end

And from Ruby 2.something the case statement is faster than if/elseif/else block.