Last Updated: February 25, 2016
·
1.853K
· mdobson

Define singleton methods for ruby class members

https://gist.github.com/3071299

I've been writing a simple utility for MongoDB. Ran into an issue where methods were being overwritten for all instances of the class. Figured out that all the methods need to be defined as singletons on each instance so that the proper data is returned. This will work for ruby 1.9.2. May be a busch league mistake, but hey we all gotta learn some time.