From: Robert Klemme Date: 2007-09-19T07:00:04+09:00 Subject: Re: capturing access to array elements On 18.09.2007 20:47, Phrogz wrote: > On Sep 18, 11:10 am, mortee wrote: >> So which methods in Array do I have to override, if I want to make sure >> I can capture any attempt to access an array element? In other words, >> which are the Array methods which don't rely on other ones to access >> elements? > > Unfortunately, there isn't a single method that accesses the value at > a particular index. For example, see the following code. Note that the > #[] method isn't called by the other methods, including each. (Note > also that the following is not an exhaustive list, but does give you a > starting point for experimentally determining which method might call > others.) Having said that it's probably easier to use Delegator to intercept method calls. Maybe there's also another approach to solving this. Mortee, what are you trying to achieve? Kind regards robert