This is how I do it and it works fine. Notice that I do not do the 
registration while initialising the object but with another method. This 
is because (as far as I understand) while the initialise method is 
executed by the object generator of the class, the object was not 
actually created yet.


   def onstream(stream_object,pond_label)
       raise "#{pond_label} already used. Must be unique\n" unless
             (stream_object.pond_registry[pond_label].nil?)

       stream_object.pond_registry[pond_label] = self
   end

-- 
Posted via http://www.ruby-forum.com/.