3 ms·
About the only change I would make to your layout is to put a line break after the “?”, with the value sub-indented on the next line, to avoid “guessing” /maint
by Roboprog 7y ago
About the only change I would make to your layout is to put a line break after the “?”, with the value sub-indented on the next line, to avoid “guessing” /maintaining how far to tab over the value column.
Thus, it would be layed out like an else-if chain, but without the extra verbiage, particularly the repeated assignment.
(I can’t put in a proper example from my iPad, as it wants to capitalize all the lines, etc)
Disclaimer: Ruby was very influential to me in the mid 2000s, even if I never wrote any for pay. The if (else-if...) statement in Ruby works like a ternary chain in C based languages.