Article: DRYer Ruby Class Definitions w/ Struct

Ruby logo

http://www.runtime-era.com/2014/04/dryer-ruby-class-definitions-w-struct.html

From the article:

Many web developers subscribe to a principle know as the DRY principle. It translates to Don’t Repeat Yourself. I try my best to adhere to the DRY principle, but sometimes I repeat snippets of code here and there, especially if the footprint is small. Well, today, a coworker showed me a clever way to DRY up some of my “small footprint” repeated code. It’s probably some age-old Ruby technique, but I just discovered it today, and I’m really excited about it! So, I’ll share it.