module Foo def function1 end def function2 end def function3 end end module MiniFoo include Foo not_wanted_methods = Foo.instance_methods - %w(function1 function2) not_wanted_methods.each {|m| undef_method m} end class Whatever include MiniFoo end