From: Artur Merke Date: 2004-12-10T19:07:26+09:00 Subject: adding object attributes Hi class A attr_accessor :a end a= A.new b= A.new #this adds a new attribute to the object 'b' def b.dummy @dummy end def b.dummy=(val) @dummy= val end b.dummy= "hello world" print "\n", b.dummy Is there a shorthand notation for adding attributes to an object? For example one could think of the equivalent of adding an attribute to a class, like b.attr_accessor(:dummy) #illegal in ruby Of course I could define a sort of public 'attr_accessor' for the class 'A' by myself, but I do NOT want to change/extend the class, only some objects. any suggestions? Artur