Skip to content

Instantly share code, notes, and snippets.

@nedzadarek
Created June 19, 2014 09:26
Show Gist options
  • Save nedzadarek/e651c16b6e768b8f30df to your computer and use it in GitHub Desktop.
Save nedzadarek/e651c16b6e768b8f30df to your computer and use it in GitHub Desktop.
`extend self` vs `extend A::B`
module A
# evil module:
module A
module B
def foo
:evil_foo
end
end
end
# good module:
module B
def foo
:good_foo
end
extend A::B
end
end
A::B.foo
# => :evil_foo
# it is not :good_foo!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment