Feature #9887

Add uninclude please

Added by Robert A. Heiler 11 months ago. Updated 11 months ago.

[ruby-core:62871]
Status:Open
Priority:Low
Assignee:-

Description

Hi!

I would like to have a way to cleanly uninclude a module.

Consider:

module Foo
  TEST = '123'
end
class Bar
  include Foo
end

Now I would like to uninclude Foo. I can remove constants and methods already,
i.e. via remove_method or undef* and constants can be removed as well but
I would like to have something like:

class Bar
  uninclude Foo
end

or

Bar.uninclude Foo
Bar.remove_ancestors Foo

Would this be possible? It might be useful but perhaps there is a
reason why this can not be added.


Related issues

Duplicates Ruby trunk - Feature #8967: add uninclude and unextend method Open 09/30/2013

History

#1 Updated by Nobuyoshi Nakada 11 months ago

  • Tracker changed from Bug to Feature
  • Description updated (diff)

Same as #8967

#2 Updated by Nobuyoshi Nakada 11 months ago

  • Duplicates Feature #8967: add uninclude and unextend method added

Also available in: Atom PDF