When might you use the do/end syntax versus using the curly bracket syntax for a block?

Technology CommunityCategory: RubyWhen might you use the do/end syntax versus using the curly bracket syntax for a block?
VietMX Staff asked 3 years ago

The do/end syntax for a block is commonly used for multi-line statements. An alternate convention is to use curly bracket syntax for blocks that return a value while using do/end syntax for blocks that change the state of the system somehow and do not return a value.