Skip to content

Instantly share code, notes, and snippets.

@mdub
Created May 16, 2013 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdub/5588589 to your computer and use it in GitHub Desktop.
Save mdub/5588589 to your computer and use it in GitHub Desktop.
Ruby module include order matters!
module M; end
module Soup; end
class C; include M; end
module M; include Soup; end
C.ancestors #=> [C, M, Object, Kernel, BasicObject]
module M; end
module Soup; end
module M; include Soup; end
class C; include M; end
C.ancestors #=> [C, A, Soup, Object, Kernel, BasicObject]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment