39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'ext/mixology/mixology.c', line 39
def unmix(mod_to_unmix)
last_super = metaclass
this_super = metaclass.direct_superclass
while this_super
break if this_super == self.class
if (this_super == mod_to_unmix ||
this_super.respond_to?(:module) && this_super.module == mod_to_unmix)
reset_method_cache
last_super.superclass = this_super.direct_superclass
reset_method_cache
return self
else
last_super = this_super
this_super = this_super.direct_superclass
end
end
self
end
|