From: Lyle Johnson Date: 2002-09-29T07:50:04+09:00 Subject: Re: alias versus method_missing Joel VanderWerf wrote: > It's a little less efficient, but this seems to be virtual: > > class Base > def bar; foo; end > end Perhaps less efficient than an alias, but certainly more efficient than the convoluted method_missing approach I was considering. I like this because (as you've shown) I can still squeeze each "virtual alias" on to a single line. > There must be a way to use Class#inherited to good effect, but the > following doesn't seem to work: Assuming we were able to make this kind of approach work, I wonder which one's more efficient in terms of storage. In other words, assume the extreme case that Base wants a *lot* of aliases for its methods. If you just define those "aliases" as differently-named instance methods (the approach described above) you've added N new instance methods total. On the other hand, if set up true aliases in each of Base's subclasses (via the Class#inherited trick) then it's N*M aliases (where M is the number of subclasses).