Wayne E. Seguin wrote:
> On Aug 13, 2007, at 13:05 , ara.t.howard wrote:

> > obj = Object.new.instance_eval do
> >
> >   @var = 42
> >
> >   def method
> >     @var
> >   end
> >
> >   self
> > end
>
> What does the self at the end accomplish?

It makes the block return the value of self (i.e. the newly created object). 
Otherwise the return value of the block would be nil (since def returns nil)
and thus obj would be nil.


-- 
Jabber: sepp2k / jabber.org
ICQ: 205544826