From: Ola Bini Date: 2006-08-29T15:26:58+09:00 Subject: Re: Partial append_features? Logan Capaldo wrote: > > % cat Projects/Ruby Experiments/append_from.rb > class Module > def append_from( mod, *methods_to_keep ) > methods_to_keep.map! { |m| m.to_s } > methods_to_remove = mod.instance_methods(false) - methods_to_keep > new_mod = Module.new > new_mod.module_eval do > include mod > methods_to_remove.each { |meth| undef_method meth } > end > include new_mod > end > end > Hi, Thank you for writing it up for me. This was more or less what I had in mind of writing up myself. This solution is definitely the best for me, since the methods I want to keep is a small subset compared to how many to remove, and the ones to remove will grow with time. Thanks. -- Ola Bini (http://ola-bini.blogspot.com) JvYAML, RbYAML, JRuby and Jatha contributor System Developer, Karolinska Institutet (http://www.ki.se) OLogix Consulting (http://www.ologix.com) "Yields falsehood when quined" yields falsehood when quined.