When writing object oriented code, a pretty useful technique is delegation–letting one object figure things out by sending messages to another object.
When writing object oriented code, a pretty useful technique is delegation–letting one object figure things out by sending messages to another object.
It’s Ruby. And yes, it could be simpler as a plain, pure function. There is nothing that warrants having the temporary objects, no tricky long-lived state, no leased/shared resource, etc