Episode #589
Mixed Argument Struct

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.

Members only

Log in below or get 48-hour access for $5.

Need more time? See all available plans.