From: Matt Armstrong Date: 2003-01-03T02:19:27+09:00 Subject: Re: Reference to a class's superclass David Landrith writes: > How do I obtain a reference to a classes superclass within a class so > that I can call superclass methods arbitrarily from the subclass? > > I am extending the array class, and I need to access certain methods > in the array class (other than the one that I am currently using in > the subclass--so that super won't work) in order to get the > functionality that I am looking for. ts writes: > alias ? Yes you must alias the original method to a different name before you redefine it in the sublcass. class Foo < Array alias_method :super_concat, :concat def concat(other) do_whatever(other) end def do_whatever(other) super_concat(other) end end