Hacker News new | past | comments | ask | show | jobs | submit login

> 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++p...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: