Robert Feldt <feldt / ce.chalmers.se> writes:

> Hi,
> 
> Is there a better/other way of aliasing a class than doing
> 
> class OC
>   # Stuff here...
> end
> 
> class AliasForOC < OC
> end

Believe it or not:

    AliasForOC = OC

A class name is just a constant that references the underlying class
object.


    class Bert
      def sayHi
        puts "Hi"
      end
    end

    Ernie = Bert

    puts Ernie.type      # Class
    e = Ernie.new
    puts e.type          # Bert
    e.sayHi              # Hi



Regards



Dave