Hi,

In message "[ruby-talk:15248] Re: class << self"
    on 01/05/16, Hans-Dieter Stich <hdstich / commplex-media.de> writes:

|> >   Class A
|> >     class << self
|> >       def method1
|> >       end
|> >     end
|> >   end
|> > 
|> > and
|> > 
|> >   Class A
|> >     def A.method1
|> >     end
|> >   end
|> > 
|> > ???
|> > 
|> > ciao
|> > h-d
|> 
|> These two forms are equivalent and define the same singleton method A.method1.
|
|ok, i agree to you, but are their any advantages or
|disadvantages for using the one or other form?

The former is full form, you can do everything, define, undefine,
alias, etc.  The latter is simple form.  It's easier and appearance is
similar to invocation form.

							matz.