Skip to content

Instantly share code, notes, and snippets.

@drbrain

drbrain/output Secret

Created August 3, 2016 00:58
Show Gist options
  • Save drbrain/e1dca41910cbd7cc66729a65de424f7f to your computer and use it in GitHub Desktop.
Save drbrain/e1dca41910cbd7cc66729a65de424f7f to your computer and use it in GitHub Desktop.
$ ruby t.rb
[MyClass, D, C, ClassForIncludes, B, A, Object, Kernel, BasicObject]
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