From: Adam Skobi Date: 2008-10-20T06:40:45+09:00 Subject: Re: Proc metaprogramming tricks? > class C > def self.inherited(klass) > klass_name = klass.name[/[^:]+$/] > klass.to_s.split(/::/)[0...-1].inject(Object) { |const, name| > const.const_get name > }.send :remove_const, klass_name > C.const_set klass_name, klass > end > end > NB: Don't do this. Yes! Why haven't I thought of this solution?! Thanks for that one. Are the any non obvious reasons as why not to do this type of trick (code obfuscation, maintance hell etc.)? -- Adam Skobi