Skip to content

Instantly share code, notes, and snippets.

@sinsoku
Created October 5, 2022 13:14
Show Gist options
  • Save sinsoku/250ab5e9e6261800edf863a6c22999b0 to your computer and use it in GitHub Desktop.
Save sinsoku/250ab5e9e6261800edf863a6c22999b0 to your computer and use it in GitHub Desktop.
module A; end
module B; end
module C; end
class Foo
include A
include B
include C
end
class Bar
include A, B, C
end
p Foo.ancestors
#=> [Foo, C, B, A, Object, Kernel, BasicObject]
p Bar.ancestors
#=> [Bar, A, B, C, Object, Kernel, BasicObject]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment