what is a singleton class ? why they have been created? and what is the impact of them on the consistency? .I am running into some confusions while doing meta-programming in Ruby
Asked
Active
Viewed 74 times
1 Answers
0
A singleton class is allegedly better form than a global variable. Rather than a single guy out there in space, a nice, compact class is asserted, where the variable itself is encapsulated and specific methods are defined to retrieve its value and to modify its value. Some would say that this is "much ado about nothing": I'm one of them.

Bruce David Wilner
- 463
- 2
- 4
-
2What you mentioned is _singleton pattern_, not _singleton class_ in Ruby. – Aetherus Jul 31 '16 at 00:35