banister / remix

Ruby modules re-mixed and remastered
32 stars 1 forks source link

Make remove_module recurse through superclass chain of module #4

Closed banister closed 14 years ago

banister commented 14 years ago
A = Module.new
B = Module.new
C = Module.new

module M
    include C, B, A
end

module N
    include M
end

N.ancestors #=> [N, M, C, B, A]

# true for recurse superclasses
N.remove_module(M, true) 
N.ancestors #=> [N]