Semantic style Ruby blocks (opens in new tab)
Here’s another blog post vouching for writing Ruby blocks using the semantic rule. Sometimes called “the Weirich rule” because of Jim Weirich’s “Braces vs. Do/End” article1 and an issue he filed against rubocop/ruby-style-guide. The rule unambiguously answers the question posed by Weirich: “When should you use {} for blocks and when should you use do/end?” His answer:
Read the original article