September 2011
1 post
3 tags
Singleton Classes on Ruby
First, this post is not about Singleton Pattern. Every object on Ruby belongs to two classes. The class that  instantiated it and one anonymous class. This anonymous class is named Singleton Class. We can access the Singleton class using something like that: class << my_class end In that example, my_class is the Singleton Class that I want. So we can add a new method using something...
Sep 5th