Module.class_eval do def dup_including(*methods) dup.class_eval do aliased = (methods.last.is_a? Hash) ? methods.last : {} aliased.each{ |from, to| alias_method to, from } to_be_kept_methods = methods + aliased.values (all_instance_methods - to_be_kept_methods).each{ |m| remove_method m } self end end def all_instance_methods private_methods = (respond_to? :private_instance_methods) ? private_instance_methods : [] instance_methods + private_methods end end