-
-
Save drbrain/e1dca41910cbd7cc66729a65de424f7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby t.rb | |
[MyClass, D, C, ClassForIncludes, B, A, Object, Kernel, BasicObject] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module A | |
end | |
module B | |
end | |
module C | |
end | |
module D | |
end | |
class ClassForIncludes | |
end | |
class MyClass < ClassForIncludes | |
include C | |
include D | |
end | |
# determine what to include (A, B) | |
class ClassForIncludes | |
include A | |
include B | |
end | |
p MyClass.ancestors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment