From: Thomas Wieczorek Date: 2008-01-23T20:02:12+09:00 Subject: Re: singleton definition differences On Jan 23, 2008 11:30 AM, Keynan Pratt wrote: > Not to hijack the thread but does singleton not refer to a pattern > method that instantiates and returns an object reference and for future > calls returns the reference of the object which has been cached in > memory to prevent instantiation of duplicate instances > There are singleton methods in Ruby. They have nothing in common with the Singleton pattern as you described it. You can define singleton methods for objects, e.g. in irb irb(main):001:0> foo = "Hello World" => "Hello World" irb(main):002:0> class << foo irb(main):003:1> def shuffle irb(main):004:2> split(//).sort { rand }.join '' irb(main):005:2> end irb(main):006:1> end => nil irb(main):007:0> foo.shuffle => "d HWloorlle" As you can see, you can modify the methods of single objects instead modifying the whole class.