--1926193751-159575188-12095644630890
Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-159575188-1209564463=:10890"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1926193751-159575188-12095644630890
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

Hi --

On Wed, 30 Apr 2008, IƱaki Baz Castillo wrote:

> 2008/4/30, David A. Black <dblack / rubypal.com>:
>
>>  object = Object.new
>>  class << object
>>   attr_accessor :params
>>  end
>>  object.params = {}
>>
>>  def object.[]=(key,value)
>>   @params[key] = value
>>  end
>>
>>  object[1] = 2
>>
>>  p object.params   # { 1 => 2 }
>
>
> Oh, that seems really interesting, but unfortunatelly I can't
> unerstand at all what yuo do there.
> Specially I don't understand the meaning of first two lines:
>
>  object = Object.new
>  class << object
>
> What does that "class" mean??

http://www.wobblini.net/singletons.html


David

-- 
Rails training from David A. Black and Ruby Power and Light:
   INTRO TO RAILS         June 9-12            Berlin
   ADVANCING WITH RAILS   June 16-19           Berlin
   INTRO TO RAILS         June 24-27           London (Skills Matter)
See http://www.rubypal.com for details and updates!
--1926193751-159575188-12095644630890--
--1926193751-159575188-12095644630890--