From: Cameron McBride Date: 2006-02-17T02:07:41+09:00 Subject: Re: Newbie: how to dynamically add methods? On 2/16/06, dblack@wobblini.net wrote: > Except for some minor differences that usually don't matter, these two > things are equivalent: > > def a.meth > end > > and > > class << a > def meth > end > end > > In both cases, you're defining a method that only the object a can > call. It also might be worth pointing out that if 'a' is a class, you'll be adding a class method. so the notation class << self ... is often used within a class to defind a class method. This type of usage is described on page 34 in PickAxe 2 (the sidebar thing). Cameron