From: Victor 'Zverok' Shepelev Date: 2006-10-26T20:44:13+09:00 Subject: Re: ruby-prof vs. Object#clone Jan Svitok (jan.svitok@gmail.com) 26/10/2006 14:38:01 > > One of reasons, why I use those strange techniques, is to have different > > sets of methods in different sets of objects of same class. > > > > More specially, all those objects are HTML DOM nodes, and I want to have > > #cell(col, row) method for node, #click method for
> class=grid>. My approach is on-the-fly per-CSS-selector extending of > > certain nodes, and it works well, except for profiling :( > > > > The issue still open. > > Maybe you can create new subclasses instead: > > my_new_class = Class.new(MyClass) > my_new_class.module_eval {...} > > and optionally > Object.const_set(my_new_class_name, mynewclass) Hmmm... Sounds reasonable. I'll try. Thanks, Jan! V.