Skip to content

Instantly share code, notes, and snippets.

@dinks
Created April 22, 2015 13:04
Show Gist options
  • Save dinks/8a1ed1ee14e5fc6209e5 to your computer and use it in GitHub Desktop.
Save dinks/8a1ed1ee14e5fc6209e5 to your computer and use it in GitHub Desktop.
Prepend versus Include
module AA
def hi
end
end
class A
include AA
end
class B
prepend AA
end
p A.ancestors # [A, AA, Object, Kernel, BasicObject]
p B.ancestors # [AA, B, Object, Kernel, BasicObject]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment