From: Daniel Brockman Date: 2005-07-26T10:34:50+09:00 Subject: Re: An array updatable? Hi EdUarDo, > Why can I access cars and modify it if I have not declared > it [with] attr_writer? JEGII> The code you show is not changing cars, it's just JEGII> calling methods on the Array cars holds. If you want JEGII> to disallow this, you'll need to do some forwarding, JEGII> for the methods you wish to allow. However, I say JEGII> think and make sure this is strictly necessary before JEGII> you bolt down the gates. You might also ask yourself whether you really need to expose the array object itself. You may be able to get away with defining #each and including Enumerable, for instance. class BunchaCars include Enumerable def initialize(name) @cars = Array.new @name = name end def each @cars.each { |x| yield x } end end This approach may or may not be appropriate in your case. (We'd need more information to be able to tell.) -- Daniel Brockman So really, we all have to ask ourselves: Am I waiting for RMS to do this? --TTN.