When writing object oriented code, a pretty useful technique is delegation–letting one object figure things out by sending messages to another object.

you are viewing a single comment's thread
view the rest of the comments
[–] 1 point 1 month ago*

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

  • source
  • parent