Use Ruby’s Refinements Anywhere With An Anonymous Class
After lots of experimentation and searching over a few years I’ve finally found a way to use Ruby’s refinements conveniently and anywhere. You don’t need to define a class method to use the refinement or instantiate an instance of a class that has the using syntax in it. You may use using in an anonymous class if it is opened with the shovel operator « . Read more here: Use Ruby’s Refinements Anywhere With An Anonymous Class
Post a comment