Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dukaev/4c757d35431758a61a2e3ae4f930a3dc to your computer and use it in GitHub Desktop.
Save dukaev/4c757d35431758a61a2e3ae4f930a3dc to your computer and use it in GitHub Desktop.
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