L
Leon Bogaert
Hi all,
What I'm trying to achieve: add a variable to a class. Fill it with
data. Every nstance of that class should have access to the data in that
variable. But I want every instance be able to modify that variable,
without modifying the original value of the variable.
It's like adding methods to the singleton class of an instance (if I
explain it properly).
I think it becomes a lot clearer if you see the code I've written:
http://pastie.caboo.se/194982
I thought this guy described what I needed:
http://briancarper.net/2007/03/22/ruby-singleton-classes/
But even then I can't get it to work.
Thanks in advance!
Leon
What I'm trying to achieve: add a variable to a class. Fill it with
data. Every nstance of that class should have access to the data in that
variable. But I want every instance be able to modify that variable,
without modifying the original value of the variable.
It's like adding methods to the singleton class of an instance (if I
explain it properly).
I think it becomes a lot clearer if you see the code I've written:
http://pastie.caboo.se/194982
I thought this guy described what I needed:
http://briancarper.net/2007/03/22/ruby-singleton-classes/
But even then I can't get it to work.
Thanks in advance!
Leon