-
-
Save dukaev/4c757d35431758a61a2e3ae4f930a3dc 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
irb(main):001:0> A = Module.new | |
=> A | |
irb(main):002:0> B = Module.new | |
=> B | |
irb(main):003:0> C = Class.new | |
=> C | |
irb(main):004:0> D = Class.new(C) { include A, B } | |
=> D | |
irb(main):005:0> D < C | |
=> true | |
irb(main):006:0> D < A | |
=> true | |
irb(main):007:0> D < B | |
=> true | |
irb(main):008:0> D.ancestors | |
=> [D, A, B, C, Object, Kernel, BasicObject] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment