Skip to content

Instantly share code, notes, and snippets.

@solnic
Created July 20, 2015 20:22
Show Gist options
  • Save solnic/ee0a023a48a56bd224a4 to your computer and use it in GitHub Desktop.
Save solnic/ee0a023a48a56bd224a4 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]
@dthtvwls
Copy link

D.superclass
=> C
D.is_a? A
=> false

So, no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment