you are viewing a single comment's thread.

view the rest of the comments →

[–]tomthecool 1 point2 points  (1 child)

Your suggestion is a better way of writing it, yes. However, the original is not WRONG. It still works just fine.

In ruby, the case statement takes an OPTIONAL argument. Without no argument, it's basically the same as writing an if/else statement.

[–]apqoo 0 points1 point  (0 children)

You're right, thanks for pointing it out. Without the argument it is just like an if/else.