From: Jacob Mitchell Date: 2010-07-01T01:21:26+09:00 Subject: Re: Aliasing classes --0016e68ee003ac7e44048a41be7b Content-Type: text/plain; charset=ISO-8859-1 Yes, you simply set some variable equal to the name of a class and then in that scope it's a class alias. class A attr_accessor :x def initialize @x = 2 end end a = A.new puts a.x #=> 2 B = A b = B.new puts b.x #=> 2 puts b.class #=> A On Wed, Jun 30, 2010 at 10:55 AM, Shak Shak wrote: > Hi all, > > Is it possible to alias a class? That is for ClassA.run to call > ClassB.run instead? I have a third party library requiring a dependency > which I've already defined with my own name. I'm currently subclassing, > but I was wondering if there was a better way. > > Shak > -- > Posted via http://www.ruby-forum.com/. > > --0016e68ee003ac7e44048a41be7b--