From: Barun Singh Date: 2009-02-09T06:31:00+09:00 Subject: Re: best way to protect class instance variables Thanks for all of the helpful suggestions. My concern wasn't related to malicious code, it was more just trying to find the best way to prevent someone from accidentally overwriting the value of the class instance variable without realizing it (for example, if someone accidentally types "x = MyClass.blah" instead of "x == MyClass.blah". I didn't like my original way of doing it only because it required copying all of the variable's attributes every time the accessor method was called, which seemed wasteful. So for my purposes, the "freeze" method works great.. -- Posted via http://www.ruby-forum.com/.