Completely work safe, realted to Jim's double singleton class.
http://tinyurl.com/6crlx9
http://tinyurl.com/5z35ln
Wayne
On Thu, Nov 20, 2008 at 12:46:53AM -0600, Jim Freeze wrote:
> For those that attended the meeting, here is my code where
> I introduce a singleton class in a singleton class.
>
> class C
>
> class << self
> class << self
> def foo
> "foo"
> end
> end
>
> def fred
> "fred"
> end
>
> def single
> class << self
> self
> end
> end
> end
> end
>
> p C.fred
> p C.single.foo
>
> b = C.clone
> p b.fred
> p b.single.foo # undefined method foo
>
>
>
> --
> Jim Freeze
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>