6 ms·
> A single-line block uses { }, but when it's multiple lines, it has to be changed to "do" and "end" - why? It doesn't have to be changed. {} work fine on mult
by execat 3y ago
> A single-line block uses { }, but when it's multiple lines, it has to be changed to "do" and "end" - why?
It doesn't have to be changed. {} work fine on multi-line blocks also. It's probably your linter that's forcing you to change them to do... end blocks: https://try.ruby-lang.org/playground/#code=3.times+%7B%0A++print+'Welcome+'%0A%7D&engine=cruby-3.2.0 https://try.ruby-lang.org/playground/#code=3.times+%7B%0A++p...