From: "Aryeh M. Frierdman" Date: 2003-07-07T04:32:50+09:00 Subject: Freezing an arbitary object Lets say I am doing design by contract and want to do a call like this: test=UnitTest::new foo=1 test.invariant(foo) foo+=1 # should produce an error and exit in UnitTest::invariant I want something like this (this code doesn't work): class UnitTest .... def invariant(aObj) aObj.freeze end .... end What am I missing, yes I know aObj is a reference thus freezing it does freeze the actual param.