From: Kristof Bastiaensen Date: 2004-05-03T21:04:03+09:00 Subject: Re: The code I forgot to include Hi, On Mon, 03 May 2004 20:23:39 +0900, Jean-Hugues ROBERT wrote: > So I tried: > class MyArray < Array > def self.[](*a); super[*a] end > end > x = MyArray[1,2,3] # => NoMethodError: super: no superclass method '[]' > > I don't understand what is happening because obviously Array.[]() > exists. In fact it is the only class method defined by Array: > Array.methods( false) # nota: false to avoid inherited methods, not in my > Pickaxe > MyArray.methods( false) # => ["[]"] in both cases. Perhaps that's because super works only as a method (not as an object). Try this: class MyArray < Array def self.[](*a); super(*a) end end Kristof