On Dec 2, 2006, at 7:27 PM, Joel VanderWerf wrote:

> module Foo
>    class Bar
>       def self.new(arg)
>          return super() if self != Foo::Bar

I don't believe that line does what you intend.  Try using your code  
with something like:

fb = Foo::Baz.new('baz') # => #<Foo::Baz:0x1e2ea0>

>          case arg.downcase
>             when 'baz'
>                return Baz.new(arg)
>             when 'zap'
>                return Zap.new(arg)
>          end
>       end
>    end
>
>    class Baz < Bar
>    end
>
>    class Zap < Bar
>    end
> end
>
> fb = Foo::Bar.new('baz')
> p fb # ==> #<Foo::Baz:0xb7d66c3c>

James Edward Gray II