Ruby is all about giving you choices. What if you could give users of your code the choice between whether to initialize objects with positional or keyword arguments, or some mix of the two? In today’s episode we’ll see how one short line of Ruby code can provide this ability to a Struct-based class.
