> We really want
> 
> class Foo < Class
>    def initialize( foo_state)
>     @foo_state = foo_state
>    end
> 
>    def foo_fu( bah)
>      # Knowledge of Foo making
>    end
> 
>    def new( needs_fu, stuff)
>      super( foo_fu( needs_fu), @foo_state, stuff)
>    end
> end
> 
> foo = Foo.new( 'fooless', 'stuffed')
> 
> 
> Except ruby doesn't like that
>     class Foo < Class
> bit.
> 
> It gets quite grumpy in fact.
> 
> Ruby says "can't make subclass of Class (TypeError)"

Yes, there is a way: Singleton classes or "eigenclasses":

class Foo
  def self.new(needs_fu, stuff) # Could be Foo.new, too, but self keeps
us warm and DRY.
    super(foo_fu(needs_fu), @foo_state, stuff)
  end
end

Each Class (and indeed, every other object) has its own private class,
for just that object alone, the eigenclass. It can have methods added to
with the def instance.method syntax -- self.new, in this case, or
Foo.new would work just as well -- and so, Foo.new is different than
another class's new method. Since it's a "virtual" child class of Class,
it works as you'd expect with regards to super.

Aria