From: gabriele renzi Date: 2004-05-28T22:00:04+09:00 Subject: Re: Struct derivation il 26 May 2004 23:49:03 GMT, Philipp Kern ha scritto:: >Hi Ruby folks. > >It's impossible to me to inherit a class from Struct when the class does not >share its constructor with the Struct superclass. >Struct implements .new on its own, instead of properly implementing it by >initialize, so the following is impossible: then do the same thing :) >> class MyStruct < Struct >> def self.new() Struct.new('Foo',:bar) end >> # optionally define initialize and call it in new()'s result ?> end => nil >> Foo=MyStruct.new => Struct::Foo >> f=Foo.new => # >> f.bar=10 => 10