The Ruby Module Builder Pattern
Did you know that Ruby has configurable modules? Just subclass the Module class, dynamically define some methods in an initializer, and include an instance of the resulting module in another class. I call this thing a “Module Builder” and I just wrote a long blog post explaining what it’s all about. Ruby’s had this secret up its sleeve for all these years, and most of us never knew about it.
Post a comment