mendicant-university/newman — comment on commit c17fd52e0706cf80e46ffbfec08e3ff80428aa92
File: lib/newman/mailer.rb line 4
By sandal:

Basically, this approach is the most (conceptually) simple way of implementing the singleton pattern in Ruby. Rather than creating an instance of class and then disabling its ability to create new instances, and rather than creating a module or class with module level methods and then putting all the state at that level but STILL disabling instantiation/use as a mixin, this approach simply creates a single instance of a bare object and directly adds functionality to it.

There are tradeoffs to this approach, and for the most part Ruby does not have an elegant option for building singleton objects. I discuss all the different approaches in [this Practicing Ruby article](http://practicingruby.com/articles/shared/jleygxejeopq).