From: Jamis Buck Date: 2003-12-16T00:50:30+09:00 Subject: Re: Subclassing Array Hans Fugal wrote: >Am I on the right track? Does anyone know which methods I would have to >override? > > Well, looking at the ruby sources, it appears that Array is completely implemented in C (which makes sense, given that it's one of the core classes). However, this means that each of the operations on Array don't call a ruby method, they call the corresponding C function directly. Thus, it doesn't appear that you can simply override one single method and change the behavior of multiple other methods. :( Unfortunate, but it makes for much faster Array methods, I suppose. -- Jamis Buck jgb3@email.byu.edu ruby -h | ruby -e 'a=[];readlines.join.scan(/-(.)\[e|Kk(\S*)|le.l(..)e|#!(\S*)/) {|r| a << r.compact.first };puts "\n>#{a.join(%q/ /)}<\n\n"'