Ruby's Complex Branching Options
April 29, 2024
Working on some personal projects where I’m not constrained by older versions of Ruby or on Rails, I’ve been trying to learn and use features of Ruby introduced in the last few years. One feature is pattern-matching, and it’s caused me to ask the question: what is the best way to create a branching control structure in Ruby?
Before going into this, I was solidly team if
statements, but now I’m not so sure.